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


TypeScript SuperTest.put方法代码示例

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


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

示例1: it

 it(`should return ${tests.newSpace.statusCode}`, async () => {
   return supertest
     .put(`${getUrlPrefix(spaceId)}/api/spaces/space/marketing`)
     .auth(user.username, user.password)
     .send({
       name: 'marketing',
       id: 'marketing',
       description: 'a description',
       color: '#5c5959',
     })
     .expect(tests.newSpace.statusCode)
     .then(tests.newSpace.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:13,代码来源:update.ts

示例2: it

 it(`should return ${tests.doesntExist.statusCode}`, async () => {
   await supertest
     .put(
       `${getUrlPrefix(spaceId)}/api/saved_objects/visualization/${getIdPrefix(
         spaceId
       )}not an id`
     )
     .auth(user.username, user.password)
     .send({
       attributes: {
         title: 'My second favorite vis',
       },
     })
     .expect(tests.doesntExist.statusCode)
     .then(tests.doesntExist.response);
 });
开发者ID:njd5475,项目名称:kibana,代码行数:16,代码来源:update.ts

示例3: async

export const createUsersAndRoles = async (es: any, supertest: SuperTest<any>) => {
  await supertest
    .put('/api/security/role/kibana_legacy_user')
    .send({
      elasticsearch: {
        indices: [
          {
            names: ['.kibana*'],
            privileges: ['manage', 'read', 'index', 'delete'],
          },
        ],
      },
    })
    .expect(204);

  await supertest
    .put('/api/security/role/kibana_dual_privileges_user')
    .send({
      elasticsearch: {
        indices: [
          {
            names: ['.kibana*'],
            privileges: ['manage', 'read', 'index', 'delete'],
          },
        ],
      },
      kibana: [
        {
          base: ['all'],
          spaces: ['*'],
        },
      ],
    })
    .expect(204);

  await supertest
    .put('/api/security/role/kibana_dual_privileges_dashboard_only_user')
    .send({
      elasticsearch: {
        indices: [
          {
            names: ['.kibana*'],
            privileges: ['read', 'view_index_metadata'],
          },
        ],
      },
      kibana: [
        {
          base: ['read'],
          spaces: ['*'],
        },
      ],
    })
    .expect(204);

  await supertest
    .put('/api/security/role/kibana_rbac_user')
    .send({
      kibana: [
        {
          base: ['all'],
          spaces: ['*'],
        },
      ],
    })
    .expect(204);

  await supertest
    .put('/api/security/role/kibana_rbac_dashboard_only_user')
    .send({
      kibana: [
        {
          base: ['read'],
          spaces: ['*'],
        },
      ],
    })
    .expect(204);

  await supertest
    .put('/api/security/role/kibana_rbac_default_space_all_user')
    .send({
      kibana: [
        {
          base: ['all'],
          spaces: ['default'],
        },
      ],
    })
    .expect(204);

  await supertest
    .put('/api/security/role/kibana_rbac_default_space_read_user')
    .send({
      kibana: [
        {
          base: ['read'],
          spaces: ['default'],
        },
      ],
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例4: async

export const createUsersAndRoles = async (es: any, supertest: SuperTest<any>) => {
  await supertest.put('/api/security/role/kibana_legacy_user').send({
    elasticsearch: {
      indices: [
        {
          names: ['.kibana*'],
          privileges: ['manage', 'read', 'index', 'delete'],
        },
      ],
    },
  });

  await supertest.put('/api/security/role/kibana_dual_privileges_user').send({
    elasticsearch: {
      indices: [
        {
          names: ['.kibana*'],
          privileges: ['manage', 'read', 'index', 'delete'],
        },
      ],
    },
    kibana: {
      global: ['all'],
    },
  });

  await supertest.put('/api/security/role/kibana_dual_privileges_dashboard_only_user').send({
    elasticsearch: {
      indices: [
        {
          names: ['.kibana*'],
          privileges: ['read', 'view_index_metadata'],
        },
      ],
    },
    kibana: {
      global: ['read'],
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_user').send({
    kibana: {
      global: ['all'],
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_dashboard_only_user').send({
    kibana: {
      global: ['read'],
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_default_space_all_user').send({
    kibana: {
      space: {
        default: ['all'],
      },
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_default_space_read_user').send({
    kibana: {
      space: {
        default: ['read'],
      },
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_space_1_all_user').send({
    kibana: {
      space: {
        space_1: ['all'],
      },
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_space_1_read_user').send({
    kibana: {
      space: {
        space_1: ['read'],
      },
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_space_2_all_user').send({
    kibana: {
      space: {
        space_2: ['all'],
      },
    },
  });

  await supertest.put('/api/security/role/kibana_rbac_space_2_read_user').send({
    kibana: {
      space: {
        space_2: ['read'],
      },
    },
  });

//.........这里部分代码省略.........
开发者ID:njd5475,项目名称:kibana,代码行数:101,代码来源:create_users_and_roles.ts


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