当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.includeDeepMembers方法代码示例

本文整理汇总了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" ]]);
  });
开发者ID:disco-network,项目名称:odata-rdf-interface,代码行数:10,代码来源:sparql_graphpatterns_spec.ts

示例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();
        });
开发者ID:kodeballer,项目名称:neon,代码行数:13,代码来源:new.ts

示例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++;
    }
  });
}
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:44,代码来源:migrations.ts


注:本文中的chai.assert.includeDeepMembers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。