當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript test.test類代碼示例

本文整理匯總了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;未經允許,請勿轉載。