Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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!");
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');
});
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() {
it('should be curried', function() {
assert.isTrue(RA.lengthGt(1, [1, 2]));
assert.isTrue(RA.lengthGt(1)([1, 2]));
});
});
it("如果含有小时的描述符号,返回true", function ()
{
assert.isTrue(TopJs.Date.formatContainsHourInfo("d/m/Y H:i:s"));
});
it("如果不含小时的描述符号,返回false", function ()
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)
})
it("'/path/to/file' returns true", function() {
assert.isTrue(U.isPath(PATH.unixToOs('/path/to/file')));
});
Postcode.nearestPostcodes(farAway, (error, farawayPostcodes) => {
if (error) return done(error);
assert.isTrue(farawayPostcodes.length >= postcodes.length);
done();
});
});
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);
});
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",
);
});
});