How to use the chai.assert.equal function in chai

To help you get started, we’ve selected a few chai 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 ExpediaDotCom / c3vis / test / configSpec.js View on Github external
it('should override with environment values', function() {
    process.env.TARGET_ENV = "test";
    // Invalidate cached config module so we can load it again with new TARGET_ENV
    delete require.cache[require.resolve(CONFIG_MODULE_FILE_NAME)];
    const subject = require(CONFIG_MODULE_FILE_NAME);
    checkDefaults(subject);
    assert.equal(subject.environmentName, "Test");
  });
});
github eddyystop / feathers-tests-fake-app-users / test / example.js View on Github external
verifyReset.create({ action: 'resend', value: email }, {}, (err, user) => {
      assert.strictEqual(err, null, 'err code set');

      // Check user record modified as expected
      assert.strictEqual(user.isVerified, false, 'isVerified not false');
      assert.isString(user.verifyToken, 'verifyToken not String');
      assert.equal(user.verifyToken.length, 30, 'verify token wrong length');
      aboutEqualDateTime(user.verifyExpires, makeDateTime());

      // Check database record is identical
      assert.deepEqual(user, db[0]);

      done();
    });
  });
github litwin90 / junior-frontend-developer-interview-questions / test / datatypes.spec.js View on Github external
it('min', () => {
            const binaryThree = new BinaryThree();
            binaryThree.add(1);
            binaryThree.add(5);
            binaryThree.add(4);
            binaryThree.add(6);
            binaryThree.add(3);
            assets.equal(binaryThree.min(), 1);
        });
github mohayonao / timbre.js / test / max.js View on Github external
it("process() : kr", function() {
        var sin   = T("cell.sin");
        var pulse = T("cell.pulse", {mul:0.25});
        var tri   = T("cell.tri");
        var t = T("max", sin, pulse, tri).kr();
        var val, cell = t.process(0);
        val = Math.max(sin.cell[0], Math.max(pulse.cell[0], tri.cell[0]));
        assert.closeTo(cell[0], val, 1e-6);
        for (var i = 1, imax = cell.length; i < imax; ++i) {
            assert.equal(cell[0], cell[i]);
        }
    });
});
github codeforequity-at / botium-core / test / compiler / compilerxlsx.spec.js View on Github external
it('should read !! as !', async function () {
      const scriptBuffer = fs.readFileSync(path.resolve(__dirname, 'convos', 'convos_with!!.xlsx'))
      const context = buildContext()
      const caps = {
      }
      const compiler = new Compiler(context, Object.assign({}, DefaultCapabilities, caps))

      compiler.Compile(scriptBuffer, 'SCRIPTING_TYPE_CONVO')
      assert.equal(context.convos[0].conversation[1].messageText, '!test 2')
      assert.equal(context.convos[0].conversation[1].not, false)
    })
    it('should read n*! as (n-1)*!', async function () {
github mozilla / fxa-auth-server / test / local / redis / index.js View on Github external
it('initialised pool correctly', () => {
    assert.equal(initialisePool.callCount, 1)
    const args = initialisePool.args[0]
    assert.equal(args.length, 2)
    assert.equal(args[0], config)
    assert.equal(args[1], log)
  })
github azuqua / notp / test / unit / dtable.js View on Github external
dtable.once("open", () => {
        assert.equal(dtable._name, "bar");
        assert.equal(dtable._path, "data/bar_DATA.SNAP");
        assert.equal(dtable._tmpDumpPath, "data/bar_DATA_PREV.SNAP");
        assert.equal(dtable._aofPath, "data/bar_LATEST.LOG");
        assert.equal(dtable._tmpAOFPath, "data/bar_PREV.LOG");
        assert.isString(dtable._id);
        assert.isNumber(dtable._fd);
        assert.ok(dtable._idleInterval);
        assert.ok(dtable._syncInterval);
        assert.ok(dtable._fstream);
        done();
      });
    });
github nicolasdao / webfunc / test / webfunc.js View on Github external
return fn(req, res).then(() => {
				assert.isOk(req)
				assert.equal(res.statusCode, 200)
				assert.equal(res._getData(), 'Action undefined. The secret password of undefined is undefined')
			})
		})))
github braintree / mallorca / test / upstream.js View on Github external
upstream.request({uri: '/', method: 'POST', data: 'some data here', attemptLimit: 1}, function(err) {
            assert.ok(err);
            assert.equal(err.message, 'Too many retries');
            done();
          });
        });
github jupe / home.js / app / lib / TimeSeries.js View on Github external
db.info( '123', function(err, obj){
      assert.equal(err, null);
      assert.equal(obj.maxRetention, 3600);
      assert.equal(obj.xFilesFactor, 0.5);
      assert.equal(obj.archives.length, 1);
      done();
    });
  });