本文整理汇总了TypeScript中chai.assert.includeDeepMembers方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.includeDeepMembers方法的具体用法?TypeScript assert.includeDeepMembers怎么用?TypeScript assert.includeDeepMembers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.includeDeepMembers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should generate triples", function() {
let gp = new gpatterns.TreeGraphPattern("?root");
gp.branch("disco:id", "?id");
gp.branch("disco:content", "?cnt").branch("disco:id", "?cntid");
assert.includeDeepMembers(gp.getDirectTriples(), [[ "?root", "disco:id", "?id" ]]);
assert.includeDeepMembers(gp.getDirectTriples(), [[ "?root", "disco:content", "?cnt" ]]);
assert.includeDeepMembers(gp.branch("disco:content")[0].getDirectTriples(), [[ "?cnt", "disco:id", "?cntid" ]]);
});
示例2: done
.run(err => {
if (err) throw err;
let pkg = JSON.parse(readFile(this.cwd, 'my-app/package.json'));
assert.propertyVal(pkg, 'description', 'Foo "bar"');
assert.deepPropertyVal(pkg, 'repository.url', 'http://www.example.com/foo.git?bar=%22baz%22');
assert.propertyVal(pkg, 'author', 'Foo "Bar" Baz <hughjass@example.com>');
let cargo = TOML.parse(readFile(this.cwd, 'my-app/native/Cargo.toml'));
assert.includeDeepMembers(cargo.package.authors, ['Foo "Bar" Baz <hughjass@example.com>'])
done();
});
示例3: assertMigrationCount
export function assertMigrationCount(
migrationCount: number,
sqlsCount = migrationCount
) {
assert.ok(
fs.existsSync(path.join(__dirname, '..', '..', 'migrations')),
'./migrations folder exists'
);
let migrationsFiles = fs.readdirSync(
path.join(__dirname, '..', '..', 'migrations')
);
assert.ok(
fs.existsSync(path.join(__dirname, '..', '..', 'migrations', 'sqls')),
'./sqls folder exists'
);
assert.includeDeepMembers(
migrationsFiles,
['sqls', '20171203034929-first.ts'],
'./migrations folder contains sqls folder and first migration'
);
assert.isAtLeast(
migrationsFiles.length,
migrationCount,
`There are at least ${migrationCount} things in the ./migrations folder`
);
let migrationsSqlsFiles = fs.readdirSync(
path.join(__dirname, '..', '..', 'migrations', 'sqls')
);
assert.isAtLeast(
migrationsSqlsFiles.length,
sqlsCount,
`There are at least ${sqlsCount} things in the ./migrations/sqls folder`
);
let downMigrationCount = 0;
let upMigrationCount = 0;
migrationsSqlsFiles.forEach(fileName => {
if (fileName.includes('-down')) {
downMigrationCount++;
}
if (fileName.includes('-up')) {
upMigrationCount++;
}
});
}