• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript test.test类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: runtest

runtest('autocomplete:script', () => {
  test
    .stdout()
    .command(['autocomplete:script', 'bash'])
    .it('outputs bash profile config', ctx => {
      expect(ctx.stdout).to.contain(`
# heroku autocomplete setup
HEROKU_AC_BASH_SETUP_PATH=${
    ctx.config.cacheDir
  }/autocomplete/bash_setup && test -f $HEROKU_AC_BASH_SETUP_PATH && source $HEROKU_AC_BASH_SETUP_PATH;
`
    )
    })

  test
    .stdout()
    .command(['autocomplete:script', 'zsh'])
    .it('outputs zsh profile config', ctx => {
      expect(ctx.stdout).to.contain(`
# heroku autocomplete setup
HEROKU_AC_ZSH_SETUP_PATH=${
    ctx.config.cacheDir
  }/autocomplete/zsh_setup && test -f $HEROKU_AC_ZSH_SETUP_PATH && source $HEROKU_AC_ZSH_SETUP_PATH;
`
    )
    })

  test
    .stdout()
    .command(['autocomplete:script', 'fish'])
    .catch(e => {
      expect(e.message).to.contain('fish is not a supported shell for autocomplete')
    })
    .it('errors on unsupported shell')
})
开发者ID:jimmyurl,项目名称:cli,代码行数:35,代码来源:script.test.ts


示例2: describe

describe('livestreamer-twitch-followed', () => {
  test
    .stdout()
    .do(() => cmd.run([]))
    .it('runs hello', ctx => {
      expect(ctx.stdout).to.contain('hello world')
    })

  test
    .stdout()
    .do(() => cmd.run(['--name', 'jeff']))
    .it('runs hello --name jeff', ctx => {
      expect(ctx.stdout).to.contain('hello jeff')
    })
})
开发者ID:skiant,项目名称:livestreamer-twitch-followed,代码行数:15,代码来源:index.test.ts


示例3: describe

describe('without specifying an app', () => {
  test
    .stderr()
    .command(['ps:autoscale:enable', '--min', '1', '--max', '2'])
    .catch(err => expect(err.message).to.contain('--app'))
    .it('aborts the command')
})
开发者ID:jimmyurl,项目名称:cli,代码行数:7,代码来源:enable.test.ts


示例4: commonSetup

function commonSetup() {
  return test
    .stderr()
    .nock(API_HOST, api => api
      .get(`/apps/${APP_NAME}`)
      .reply(200, {id: APP_ID, name: APP_NAME})
  )
}
开发者ID:jimmyurl,项目名称:cli,代码行数:8,代码来源:enable.test.ts


示例5: describe

describe('ps:autoscale:disable without a web dyno/monitor', () => {
  test
    .stderr()
    .nock(API_HOST, api => api
      .get(`/apps/${APP_NAME}`)
      .reply(200, {id: APP_ID, name: APP_NAME})
  )
    .nock(METRICS_HOST, api => api
      .get(`/apps/${APP_ID}/formation/web/monitors`)
      .reply(200, [])
  )
    .command(['ps:autoscale:disable', '--app', APP_NAME])
    .catch(err => expect(err.message).to.contain(`${APP_NAME} does not have autoscale enabled`))
    .it('throws an error')
})
开发者ID:jimmyurl,项目名称:cli,代码行数:15,代码来源:disable.test.ts


示例6: describe

import Nock from '@fancy-test/nock'
import * as Test from '@oclif/test'

import * as git from '../../../src/utils/git'

const test = Test.test
.register('nock', Nock)
const expect = Test.expect

describe('ci:rerun', () => {
  test
    .command(['ci:rerun'])
    .catch(e => {
      expect(e.message).to.contain('Required flag:  --pipeline PIPELINE or --app APP')
    })
    .it('errors when not specifying a pipeline or an app')

  describe('when specifying a pipeline', () => {
    const pipeline = {id: '14402644-c207-43aa-9bc1-974a34914010', name: 'pipeline'}
    const ghRepository = {
      user: 'heroku-fake', repo: 'my-repo', ref: '668a5ce22eefc7b67c84c1cfe3a766f1958e0add', branch: 'my-test-branch'
    }
    const oldTestRun = {
      commit_branch: ghRepository.branch,
      commit_message: 'earlier commit',
      commit_sha: '2F3CAFFD6AEEC967A7D71EB7ABEC0993D036430691E668A8710248DF4541111E',
      id: 'd76b690b-a4ce-4a7b-83ca-c30792d4f3be',
      number: 10,
      pipeline: {id: pipeline.id},
      status: 'failed'
    }
开发者ID:jimmyurl,项目名称:cli,代码行数:31,代码来源:rerun.test.ts


示例7: nock

import * as nock from 'nock'

import Nock from '@fancy-test/nock'
import {expect, test as base} from '@oclif/test'

const test = base
.register('nock', Nock)

let api = nock('https://status.heroku.com:443')

beforeEach(() => nock.cleanAll())
afterEach(() => api.done())

const time = new Date()

describe('when heroku is green', () => {
  test
  .stdout()
  .nock('https://status.heroku.com', api => {
    api.get('/api/v4/current-status').reply(200, {
      status: [
        {system: 'Apps', status: 'green'},
        {system: 'Data', status: 'green'},
        {system: 'Tools', status: 'green'},
      ],
      incidents: [],
      scheduled: [],
    })
  })
  .command(['status'])
  .it('shows success message', ctx => {
开发者ID:heroku,项目名称:heroku-status,代码行数:31,代码来源:status.test.ts


示例8: describe

import Nock from '@fancy-test/nock'
import {Fixture} from '@heroku/buildpack-registry'
import {expect, test as otest} from '@oclif/test'
import * as nock from 'nock'
// tslint:disable-next-line:no-duplicate-imports
import {Scope} from 'nock'
nock.disableNetConnect()
const test = otest.register('nock', Nock)

describe('buildpacks:search', () => {
  test
    .nock('https://buildpack-registry.heroku.com', (api: Scope) => {
      api
        .get('/buildpacks?in[namespace][]=heroku')
        .reply(200, [
          Fixture.buildpack({
            name: 'ruby',
            description: 'Official Heroku Buildpack for Ruby',
          })
        ])
    })
    .stdout()
    .command(['buildpacks:search', '--namespace', 'heroku'])
    .it('searches using the namespace', ctx => {
      expect(ctx.stdout).to.contain('heroku/ruby')
      expect(ctx.stdout).to.contain('1 buildpack found')
    })

  test
    .nock('https://buildpack-registry.heroku.com', (api: Scope) => {
      let rubyBuildpack = Fixture.buildpack({
开发者ID:jimmyurl,项目名称:cli,代码行数:31,代码来源:search.test.ts


示例9: describe

describe('certs:auto:wait', () => {
  test
    .stdout()
    .it('runs certs:auto:wait', () => { })
})
开发者ID:jimmyurl,项目名称:cli,代码行数:5,代码来源:hello.test.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript rest.authenticate函数代码示例发布时间:2022-05-28
下一篇:
TypeScript test.expect函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap