How to use the chai.assert.isTrue 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 burtonator / polar-bookshelf / web / spectron / firebase-sharing / content.ts View on Github external
public static async verifyAccessToDocs() {

            console.log("Verifying access to docs");

            await app.auth().signInWithEmailAndPassword(FIREBASE_USER1, FIREBASE_PASS1);

            console.log("Getting doc peer pendings");
            const docPeerPendings = await DocPeerPendings.get();

            assert.isTrue(docPeerPendings.length >= 1);

            // verify that at least ONE of these is the doc we're looking for

            assert.isTrue(docPeerPendings.filter(current => current.docID === docID).length >= 1);

            const docPeerPending = docPeerPendings.filter(current => current.docID === docID)[0];

            const docPeer = await DocPeerPendings.accept(docPeerPending);

            await this.verifyFileFetch(docPeer);

            console.log("We are authenticated now with the new user.");

            await firestore.collection("doc_meta").doc(docID).get();

            console.log("Got the document!");
github Webstrates / Webstrates / tests / functional-tests / 2-protected-mode.js View on Github external
it('edit on non-transient attribute set should be visible to other clients', async () => {
		await util.sleep(1);

		await pageA.evaluate(() => document.body.lastElementChild.setAttribute('y', 'Edit A'));

		const correctAttributeValueA = await util.waitForFunction(pageB, () =>
			document.body.lastElementChild.getAttribute('y') === 'Edit A');
		assert.isTrue(correctAttributeValueA, 'attribute set on client A gets reflected to B');

		await pageB.evaluate(() => document.body.lastElementChild.setAttribute('y', 'Edit B'));

		const correctAttributeValueB = await util.waitForFunction(pageA, () =>
			document.body.lastElementChild.getAttribute('y') === 'Edit B');
		assert.isTrue(correctAttributeValueB, 'attribute set on client B gets reflected to A');
	});
github ExpressGateway / express-gateway / tests / test_conditionals.js View on Github external
it('should return true if request url is the same', function() {
    assert.isTrue(run({
      url: '/foo/bar/baz'
    }, ['pathExact', '/foo/bar/baz']));
  });
  it('should return false if request url is not the same', function() {
github char0n / ramda-adjunct / test / lengthGt.js View on Github external
it('should be curried', function() {
    assert.isTrue(RA.lengthGt(1, [1, 2]));
    assert.isTrue(RA.lengthGt(1)([1, 2]));
  });
});
github qcoreteam / topjs / tests / kernel / lang / test_Date.js View on Github external
it("如果含有小时的描述符号,返回true", function ()
        {
            assert.isTrue(TopJs.Date.formatContainsHourInfo("d/m/Y H:i:s"));
        });
        it("如果不含小时的描述符号,返回false", function ()
github codekirei / node-multispinner / test / methods.js View on Github external
it('emit "err" if allSuccess is false', () => {
        let eventEmitted = false
        m.on('err', () => eventEmitted = true)
        m.error(spinner)
        clock.tick(m.interval)
        assert.isTrue(eventEmitted)
      })
github bem-archive / bem-tools / test / util.js View on Github external
it("'/path/to/file' returns true", function() {
            assert.isTrue(U.isPath(PATH.unixToOs('/path/to/file')));
        });
github ideal-postcodes / postcodes.io / test / postcode.unit.js View on Github external
Postcode.nearestPostcodes(farAway, (error, farawayPostcodes) => {
					if (error) return done(error);
					assert.isTrue(farawayPostcodes.length >= postcodes.length);
					done();
				});
			});
github char0n / ramda-adjunct / test / dispatch.js View on Github external
const isDate = sinon.stub().returns(false);
    const dateDispatch = sinon.stub().returns(false);

    const fnSwitch = RA.dispatch([
      R.ifElse(isString, stringDispatch, RA.stubUndefined),
      R.ifElse(isNumber, numberDispatch, RA.stubUndefined),
      R.ifElse(isDate, dateDispatch, RA.stubUndefined),
    ]);
    fnSwitch(1);

    assert.isTrue(isString.calledOnceWithExactly(1));
    assert.isTrue(stringDispatch.notCalled);
    assert.isTrue(isNumber.calledOnceWithExactly(1));
    assert.isTrue(numberDispatch.calledOnceWithExactly(1));
    assert.isTrue(isDate.notCalled);
    assert.isTrue(dateDispatch.notCalled);
  });
github cockroachdb / cockroach-gen / pkg / ui / src / util / analytics / trackTableSort.spec.ts View on Github external
const spy = sandbox.spy();
    const tableName = "Test table";
    const title = "test";

    track(spy)(tableName, title, "asc");

    const sent = spy.getCall(0).args[0];
    const table = get(sent, "properties.tableName");
    const columnName = get(sent, "properties.columnName");
    const direction = get(sent, "properties.sortDirection");

    assert.isTrue(isString(table), "Table name is a string");
    assert.isTrue(table === tableName, "Table name matches given table name");

    assert.isTrue(isString(columnName), "Column name is a string");
    assert.isTrue(
      title === columnName,
      "Column name matches given column name",
    );

    assert.isTrue(isString(direction), "Sort direction is a string");
    assert.isTrue(
      direction === "asc",
      "Sort direction matches the sort setting ascending property",
    );
  });
});