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


TypeScript denali-cli.CommandAcceptanceTest類代碼示例

本文整理匯總了TypeScript中denali-cli.CommandAcceptanceTest的典型用法代碼示例。如果您正苦於以下問題:TypeScript CommandAcceptanceTest類的具體用法?TypeScript CommandAcceptanceTest怎麽用?TypeScript CommandAcceptanceTest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CommandAcceptanceTest類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: async

test.beforeEach('generate an action to destroy', async (t) => {
  let generate = new CommandAcceptanceTest('generate action foobar', { name: 'destroy-command' });
  t.context.dir = generate.dir;
  t.context.generatedFilepath = path.join(generate.dir, 'app', 'actions', 'foobar.js');
  await generate.run();
  t.true(fs.existsSync(t.context.generatedFilepath), 'file should be generated');
});
開發者ID:acburdine,項目名稱:denali,代碼行數:7,代碼來源:destroy-test.ts

示例2: test

test('generates a blueprint', async (t) => {
  let generate = new CommandAcceptanceTest('generate action foobar --skip-post-install', { name: 'generate-command' });
  let generatedFilepath = path.join(generate.dir, 'app', 'actions', 'foobar.js');

  await generate.run({ failOnStderr: true });
  t.true(fs.existsSync(generatedFilepath), 'file should be generated');
});
開發者ID:acburdine,項目名稱:denali,代碼行數:7,代碼來源:generate-test.ts

示例3: test

test('skips modified files', async (t) => {
  let destroy = new CommandAcceptanceTest('destroy action foobar', { dir: t.context.dir, populateWithDummy: false });
  fs.appendFileSync(t.context.generatedFilepath, 'foobar');

  await destroy.run();
  t.true(fs.existsSync(t.context.generatedFilepath), 'file should be generated');
});
開發者ID:acburdine,項目名稱:denali,代碼行數:7,代碼來源:destroy-test.ts

示例4: test

test('prints list of configured routes', async (t) => {
  let generate = new CommandAcceptanceTest('routes', { name: 'routes-command' });

  let result = await generate.run({ failOnStderr: true });
  t.true(result.stdout.trim().endsWith(dedent`
┌───────┬────────┐
│ URL   │ ACTION │
├───────┼────────┤
│ GET / │ index  │
└───────┴────────┘
  `.trim()));
});
開發者ID:acburdine,項目名稱:denali,代碼行數:12,代碼來源:routes-test.ts

示例5: test

test('launches a server', async (t) => {
  let server = new CommandAcceptanceTest('server --port 3001', { name: 'server-command' });

  return server.spawn({
    failOnStderr: true,
    env: {
      DEBUG: null
    },
    checkOutput(stdout) {
      let started = stdout.indexOf('dummy@0.0.0 server up') > -1;
      if (started) {
        t.pass();
      }
      return started;
    }
  });
});
開發者ID:acburdine,項目名稱:denali,代碼行數:17,代碼來源:server-test.ts


注:本文中的denali-cli.CommandAcceptanceTest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。