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


TypeScript supertest.SuperTest类代码示例

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


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

示例1: async

 } when deleting a non-space-aware doc`, async () => {
   await supertest
     .get(`${getUrlPrefix(spaceId)}/api/saved_objects/globaltype/${notSpaceAwareId}`)
     .auth(user.username, user.password)
     .expect(tests.notSpaceAware.statusCode)
     .then(tests.notSpaceAware.response);
 });
开发者ID:,项目名称:,代码行数:7,代码来源:

示例2: before

      before(async () => {
        await esArchiver.load('saved_objects/spaces');

        // since we want to verify that we only delete the right things
        // and can't include a config document with the correct id in the
        // archive we read the settings to trigger an automatic upgrade
        // in each space
        await supertest
          .get('/api/kibana/settings')
          .auth(user.username, user.password)
          .expect(200);
        await supertest
          .get('/s/space_1/api/kibana/settings')
          .auth(user.username, user.password)
          .expect(200);
      });
开发者ID:njd5475,项目名称:kibana,代码行数:16,代码来源:delete.ts

示例3: it

 it(`should return ${tests.default.statusCode}`, async () => {
   return supertest
     .post(`${getUrlPrefix(currentSpaceId)}/api/spaces/v1/space/${selectSpaceId}/select`)
     .auth(user.username, user.password)
     .expect(tests.default.statusCode)
     .then(tests.default.response);
 });
开发者ID:liuyepiaoxiang,项目名称:kibana,代码行数:7,代码来源:select.ts

示例4: it

 it(`should return ${tests.exists.statusCode}`, async () => {
   return supertest
     .get(`${getUrlPrefix(spaceId)}/api/spaces/space`)
     .auth(user.username, user.password)
     .expect(tests.exists.statusCode)
     .then(tests.exists.response);
 });
开发者ID:liuyepiaoxiang,项目名称:kibana,代码行数:7,代码来源:get_all.ts

示例5: it

 it(`should return ${tests.reservedSpace.statusCode}`, async () => {
   return supertest
     .delete(`${getUrlPrefix(spaceId)}/api/spaces/space/default`)
     .auth(user.username, user.password)
     .expect(tests.reservedSpace.statusCode)
     .then(tests.reservedSpace.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:7,代码来源:delete.ts

示例6: it

 it(`should return ${tests.unknownType.statusCode}`, async () => {
   const data = createImportData(spaceId);
   data.push({
     type: 'wigwags',
     id: '1',
     attributes: {
       title: 'Wigwags title',
     },
   });
   await supertest
     .post(`${getUrlPrefix(spaceId)}/api/saved_objects/_resolve_import_errors`)
     .auth(user.username, user.password)
     .field(
       'overwrites',
       JSON.stringify([
         {
           type: 'wigwags',
           id: '1',
         },
         {
           type: 'dashboard',
           id: `${getIdPrefix(spaceId)}a01b2f57-fcfd-4864-b735-09e28f0d815e`,
         },
       ])
     )
     .attach(
       'file',
       Buffer.from(data.map(obj => JSON.stringify(obj)).join('\n'), 'utf8'),
       'export.ndjson'
     )
     .expect(tests.unknownType.statusCode)
     .then(tests.unknownType.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:33,代码来源:resolve_import_errors.ts

示例7: async

 }`, async () => {
   await supertest
     .post(`${getUrlPrefix(spaceId)}/api/saved_objects/_export`)
     .auth(user.username, user.password)
     .expect(tests.noTypeOrObjects.statusCode)
     .then(tests.noTypeOrObjects.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:7,代码来源:export.ts

示例8: it

 it(`should return ${tests.default.statusCode}`, async () => {
   await supertest
     .post(`${getUrlPrefix(spaceId)}/api/saved_objects/_bulk_create`)
     .auth(user.username, user.password)
     .send(createBulkRequests(spaceId))
     .expect(tests.default.statusCode)
     .then(tests.default.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:8,代码来源:bulk_create.ts

示例9: it

 it(tests.custom.description, async () => {
   await supertest
     .post(`${getUrlPrefix(spaceId)}/api/saved_objects/${tests.custom!.type}`)
     .auth(user.username, user.password)
     .send(tests.custom!.requestBody)
     .expect(tests.custom!.statusCode)
     .then(tests.custom!.response);
 });
开发者ID:,项目名称:,代码行数:8,代码来源:

示例10: it

 it(`should return ${tests.default.statusCode}`, async () => {
   const data = createImportData(spaceId);
   await supertest
     .post(`${getUrlPrefix(spaceId)}/api/saved_objects/_import`)
     .auth(user.username, user.password)
     .attach('file', Buffer.from(JSON.stringify(data), 'utf8'), 'export.ndjson')
     .expect(tests.default.statusCode)
     .then(tests.default.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:9,代码来源:import.ts


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