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


TypeScript assert.ok方法代码示例

本文整理汇总了TypeScript中chai.assert.ok方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.ok方法的具体用法?TypeScript assert.ok怎么用?TypeScript assert.ok使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chai.assert的用法示例。


在下文中一共展示了assert.ok方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: async

export const credentialCreateWithMsgId = async (data?: ICredentialCreateWithMsgId) => {
  if (!data) {
    data = await dataCredentialCreateWithMsgId()
  }
  const credential = await Credential.createWithMsgId(data)
  assert.notEqual(credential.handle, undefined)
  assert.equal(credential.sourceId, data.sourceId)
  assert.ok(credential.credOffer)
  return credential
}
开发者ID:fabienpe,项目名称:indy-sdk,代码行数:10,代码来源:entities.ts

示例2: it

 it('should accept tsconfigs that typescript accepts', () => {
   assert.ok(
     withCustomConfig(
       // need to navigate to root because tests run on compiled tests
       // and tsc does not include json files
       path.join(__dirname, '../../src/__tests__/data/tsconfig.json'),
       {}
     )
   );
 });
开发者ID:vcarrera,项目名称:react-docgen-typescript,代码行数:10,代码来源:parser.ts

示例3: it

  it('can compile a unifying object matcher', () => {
    let match = compileMatcher({ foo: simple('x'), bar: simple('y'), baz: simple('x') });
    let successContext = new Context();
    assert.ok(match({ foo: 1, bar: 2, baz: 1 }, successContext));
    assert.deepEqual(flattenPrototype(successContext.expose()), { x: 1, y: 2 });

    let failureContext = new Context();
    assert.notOk(match({ foo: 1, bar: 2, baz: 3 }, failureContext));
    assert.deepEqual(flattenPrototype(failureContext.expose()), {});
  });
开发者ID:salsify,项目名称:botanist,代码行数:10,代码来源:compile-matcher-test.ts

示例4: createOrderForValidData

 @test('createOrder() completes without throwing an error')
 public async createOrderForValidData() {
   let { id } = await createOrder(VALID_ORDER_DATA, [
     { productid: 1, quantity: 3, discount: 0, unitprice: 3.0 }
   ]);
   if (typeof id === 'undefined') {
     throw new Error('createOrder() should return an object with an id');
   }
   assert.ok(id, 'createOrder() returns an object with an id');
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:10,代码来源:ex07.create-order-with-details.test.ts

示例5:

 .then((deployUnit) => {
   assert.ok(deployUnit.id);
   assert.equal(deployUnit.name, newDu.name);
   assert.equal(deployUnit.version, newDu.version);
   assert.equal(deployUnit.platform, newDu.platform);
   assert.equal(deployUnit.tdefName, 'Ticker');
   assert.equal(deployUnit.tdefVersion, 3);
   assert.equal(deployUnit.namespace, 'kevoree');
   createdDu = deployUnit;
 });
开发者ID:kevoree,项目名称:kevoree-js,代码行数:10,代码来源:dus.ts


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