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


TypeScript CommandAcceptanceTest.run方法代碼示例

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


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

示例1: 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

示例2: 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

示例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 based on the dummy app in an addon', async (t) => {
  let generateAddon = new CommandAcceptanceTest('addon my-denali-addon', { name: 'server-command-dummy-app', populateWithDummy: false });
  await generateAddon.run({ failOnStderr: true });
  linkDependency(path.join(generateAddon.dir, 'my-denali-addon'), 'denali', path.join(process.cwd(), 'node_modules', 'denali'));
  let server = new CommandAcceptanceTest('server --port 3002', {
    dir: path.join(generateAddon.dir, 'my-denali-addon'),
    populateWithDummy: false
  });

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


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