當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。