How to use the assert.equal function in assert

To help you get started, we’ve selected a few assert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enokidotsite / enoki / lib / tools / page.js View on Github external
constructor (state, value) {
    assert.equal(typeof state, 'object', 'page: arg1 "state" must be type object')
    assert.equal(typeof state.content, 'object', 'page: state.content must be type object')

    // fallback route
    state.href = state.href || '/'

    // private data
    this._state = state || { }
    this._value = value || { }
  }
github csstree / csstree / test / generate.js View on Github external
it('should generate a map', function() {
            var ast = parse('.a {\n  color: red;\n}\n', {
                filename: 'test.css',
                positions: true
            });
            var result = generate(ast, { sourceMap: true });

            assert.equal(result.css, '.a{color:red}');
            assert.equal(result.map.toString(), '{"version":3,"sources":["test.css"],"names":[],"mappings":"AAAA,E,CACE,S"}');
        });
github honeybadger-io / honeybadger-node / test / honeybadger.js View on Github external
it('sets valid config options', function () {
      Honeybadger.configure({
        apiKey: 'badgers',
        environment: 'badger_env',
        endpoint: 'https://www.example.com/',
        projectRoot: 'badger_root',
        hostname: 'badger_host',
        logger: console
      });
      assert.equal('badgers', Honeybadger.apiKey);
      assert.equal('badger_env', Honeybadger.environment);
      assert.equal('https://www.example.com/', Honeybadger.endpoint);
      assert.equal('badger_root', Honeybadger.projectRoot);
      assert.equal('badger_host', Honeybadger.hostname);
      assert.equal(console, Honeybadger.logger);
    });
  });
github helmetjs / helmet / test / nocache.js View on Github external
it('names its function and middleware', function () {
    assert.equal(helmet.nocache.name, 'nocache');
    assert.equal(helmet.nocache().name, 'nocache');
  });
github angeloashmore / immutable-ics / test / integration / separateInstantiation.js View on Github external
it('should return an ICS file as a string', () => {
      assert.equal(calendar.toString(), exampleOutput)
    })
  })
github douzi8 / htmldom / test / uglify.js View on Github external
it('script type', function () {
      let $ = createHtmlDom(`
        
        
      `)


      assert.equal($.uglify(), '')
    })
github zettajs / zetta / test / test_remote_query.js View on Github external
setTimeout(function() {
        assert.equal(recv, 2);
        done();
      }, 100);
    });
github graalvm / graaljs / test / simple / test-http-legacy.js View on Github external
process.on('exit', function() {
  common.debug('responses_recvd: ' + responses_recvd);
  assert.equal(2, responses_recvd);

  common.debug('responses_sent: ' + responses_sent);
  assert.equal(2, responses_sent);

  assert.equal('The path was /hello', body0);
  assert.equal('The path was /world', body1);
});
github nfroidure / bufferstreams / tests / index.mocha.js View on Github external
(err, objs, cb) => {
                assert.equal(err.message, 'Aouch!');
                cb(null, []);
              }
            );