Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.keys(rawRepo.refs).forEach(name => {
const override = rawRepo.refs[name];
if (null !== override) {
resultArgs.refs[name] = override;
}
else {
delete resultArgs.refs[name];
}
});
// If we have a current branch, make sure it's valid and update HEAD where
// necessary.
if (null !== resultArgs.currentBranchName) {
assert.property(resultArgs.branches, resultArgs.currentBranchName);
// If the head is 'null', the repo is bare and we don't need to reset
// it. If it is not 'null', then we should make it point to the same
// commit as the current branch.
if (null !== resultArgs.head) {
resultArgs.head =
resultArgs.branches[resultArgs.currentBranchName].sha;
}
}
// Copy in new commits.
Object.assign(resultArgs.commits, rawRepo.commits);
// Copy the notes
it('should create the fields only when interacted with', () => {
const action = actions.setTouched('test.foo');
const touchedState = reducer(undefined, action);
assert.property(touchedState, 'foo');
assert.isTrue(touchedState.foo.touched);
assert.notProperty(touchedState, 'bar');
assert.notProperty(touchedState, 'baz');
});
it('should return an object with correct structure', function () {
assert.isObject(scale, 'return value is object');
assert.property(scale, 'min', 'object contains minimum');
assert.property(scale, 'max', 'object contains maximum');
assert.property(scale, 'abs', 'object contains absolute');
assert.property(scale, 'avg', 'object contains average');
});
it('should append filepath', function() {
assert.property(entries, 'test.txt');
assert.propertyVal(entries['test.txt'], 'name', 'test.txt');
assert.propertyVal(entries['test.txt'], 'date', '2013-01-03T14:26:38.000Z');
assert.propertyVal(entries['test.txt'], 'crc32', 585446183);
assert.propertyVal(entries['test.txt'], 'size', 19);
});
test('getFromIndex', async () => {
const schemaDB = await openDBWithData();
db = schemaDB as IDBPDatabase;
assert.property(schemaDB, 'getFromIndex', 'Method exists');
const val = await schemaDB.getFromIndex(
'object-store',
'title',
'Article 1',
);
typeAssert>(true);
assert.deepStrictEqual(
val,
{
id: 1,
title: 'Article 1',
date: new Date('2019-01-04'),
},
'Correct value from store',
it('source map from created file should contains property `names`', () => {
assert.property(sourceMapObject, 'names');
});
var asserts = function (t, block) {
assert.property(block, "number");
assert.property(block, "parentHash");
assert.property(block, "hash");
assert.property(block, "nonce");
assert.property(block, "sha3Uncles");
assert.property(block, "logsBloom");
assert.property(block, "transactionsRoot");
assert.property(block, "stateRoot");
assert.property(block, "miner");
assert.property(block, "difficulty");
assert.property(block, "totalDifficulty");
assert.property(block, "size");
assert.property(block, "extraData");
assert.property(block, "gasLimit");
assert.property(block, "gasUsed");
assert.property(block, "timestamp");
assert.property(block, "transactions");
assert.property(block, "uncles");
assert.isAbove(parseInt(block.number), 0);
assert.isAbove(parseInt(block.hash), 0);
assert.isAbove(parseInt(block.parentHash), 0);
assert.isAbove(parseInt(block.nonce), 0);
assert.isAbove(parseInt(block.sha3Uncles), 0);
assert.isAbove(parseInt(block.transactionsRoot), 0);
assert.isAbove(parseInt(block.stateRoot), 0);
assert.isAbove(parseInt(block.miner), 0);
assert.isAbove(parseInt(block.difficulty), 0);
var asserts = function (t, block) {
assert.property(block, "number");
assert.property(block, "parentHash");
assert.property(block, "hash");
assert.property(block, "nonce");
assert.property(block, "sha3Uncles");
assert.property(block, "logsBloom");
assert.property(block, "transactionsRoot");
assert.property(block, "stateRoot");
assert.property(block, "miner");
assert.property(block, "difficulty");
assert.property(block, "totalDifficulty");
assert.property(block, "size");
assert.property(block, "extraData");
assert.property(block, "gasLimit");
assert.property(block, "gasUsed");
assert.property(block, "timestamp");
assert.property(block, "transactions");
assert.property(block, "uncles");
assert.isAbove(parseInt(block.number), 0);
assert.isAbove(parseInt(block.hash), 0);
assert.isAbove(parseInt(block.parentHash), 0);
assert.isAbove(parseInt(block.nonce), 0);
assert.isAbove(parseInt(block.sha3Uncles), 0);
assert.isAbove(parseInt(block.transactionsRoot), 0);
assert.isAbove(parseInt(block.stateRoot), 0);
assert.isAbove(parseInt(block.miner), 0);
assert.isAbove(parseInt(block.difficulty), 0);
assert.isAbove(parseInt(block.totalDifficulty), 0);
assert.isAbove(parseInt(block.gasLimit), 0);
assert.isAbove(parseInt(block.timestamp), 0);
assert.isAbove(parseInt(block.number), 0);
req.session.reload(function(err){
assert.notOk(err, "No error when reloading session");
assert.property(req.session, "foo", "Session has new foo property");
res.json(req.session.toJSON());
});
});
var asserts = function (t, block) {
assert.property(block, "number");
assert.property(block, "parentHash");
assert.property(block, "hash");
assert.property(block, "nonce");
assert.property(block, "sha3Uncles");
assert.property(block, "logsBloom");
assert.property(block, "transactionsRoot");
assert.property(block, "stateRoot");
assert.property(block, "miner");
assert.property(block, "difficulty");
assert.property(block, "totalDifficulty");
assert.property(block, "size");
assert.property(block, "extraData");
assert.property(block, "gasLimit");
assert.property(block, "gasUsed");
assert.property(block, "timestamp");
assert.property(block, "transactions");
assert.property(block, "uncles");
assert.isAbove(parseInt(block.number), 0);
assert.isAbove(parseInt(block.hash), 0);
assert.isAbove(parseInt(block.parentHash), 0);
assert.isAbove(parseInt(block.nonce), 0);
assert.isAbove(parseInt(block.sha3Uncles), 0);
assert.isAbove(parseInt(block.transactionsRoot), 0);