当前位置: 首页>>代码示例>>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;未经允许,请勿转载。