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


TypeScript chai.expect类代码示例

本文整理汇总了TypeScript中chai.expect的典型用法代码示例。如果您正苦于以下问题:TypeScript expect类的具体用法?TypeScript expect怎么用?TypeScript expect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: it

 it("does not time out if a timeout is set and not exceeded", async () => {
   try {
     await db.query(aql`RETURN SLEEP(0.01)`, { timeout: 1000 });
   } catch (err) {
     expect.fail();
   }
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:7,代码来源:27-query-management.ts

示例2: function

    readable_mock._do_readToStream = function(offset:number, size:number) {
      expect.fail(); // should not get to this position

      return new Promise<Buffer>((resolve:PromiseResolve<Buffer>, reject:PromiseReject) => {
        reject(new Errors.InvalidArguments());
      });
    };
开发者ID:zenwarr,项目名称:microhex-js,代码行数:7,代码来源:stream.ts

示例3: it

 it(`should return 400 when mount is invalid for ${desc}`, async () => {
   try {
     await method(`/dev/null`);
     expect.fail();
   } catch (e) {
     expect(e).to.be.instanceOf(ArangoError);
     expect(e.code).to.equal(400);
   }
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:9,代码来源:22-foxx-api.ts

示例4: it

 it("deletes the given document", async () => {
   await collection.remove(key);
   try {
     await collection.document(key);
   } catch (e) {
     return;
   }
   expect.fail();
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:9,代码来源:14-document-collections.ts

示例5: it

 it("should throw if view does not exists", async () => {
   try {
     await db.arangoSearchView("no").get();
   } catch (err) {
     expect(err).to.have.property("errorNum", 1203);
     return;
   }
   expect.fail("should throw");
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:9,代码来源:25-view-metadata.ts

示例6: it

 it("deletes the given vertex", async () => {
   await collection.remove(key);
   try {
     await collection.vertex(key);
   } catch (e) {
     return;
   }
   expect.fail();
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:9,代码来源:19-graph-vertex-collections.ts

示例7: it

 it('throws an error if the embedded type is undefined', async () => {
     // Manually call the decorator
     try {
         embed([undefined])(Bundle, 'someUndefinedEmbeds', null)
         expect.fail()
     } catch(e) {
         expect(e.message).to.eq('Type of @embeds decorator at Function:someUndefinedEmbeds is undefined')
     }
 })
开发者ID:erikmuttersbach,项目名称:tiller,代码行数:9,代码来源:embedTest.ts

示例8: it

 it("should throw if collection does not exist", async () => {
   try {
     await db.collection("no").get();
   } catch (e) {
     expect(e).to.have.property("errorNum", COLLECTION_NOT_FOUND);
     return;
   }
   expect.fail("should throw");
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:9,代码来源:09-collection-metadata.ts

示例9: it

 it("fails if the database does not exist", async () => {
   db.useDatabase("__does_not_exist__");
   try {
     await db.get();
   } catch (e) {
     expect(e).to.be.an.instanceof(ArangoError);
     return;
   }
   expect.fail("should not succeed");
 });
开发者ID:arangodb,项目名称:arangojs,代码行数:10,代码来源:01-manipulating-databases.ts

示例10: catch

 nonSystemCollections.map(async name => {
   let doc;
   try {
     doc = await db.collection(name).document("example");
   } catch (e) {
     expect(e).to.be.an.instanceof(ArangoError);
     return;
   }
   expect.fail(`Expected document to be destroyed: ${doc._id}`);
 })
开发者ID:arangodb,项目名称:arangojs,代码行数:10,代码来源:01-manipulating-databases.ts


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