本文整理汇总了TypeScript中yeoman-test.run函数的典型用法代码示例。如果您正苦于以下问题:TypeScript run函数的具体用法?TypeScript run怎么用?TypeScript run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: test
test(testName, (done) => {
const TestGenerator = createElementGenerator('polymer-1.x');
helpers.run(TestGenerator).on('end', () => {
yoAssert.noFile(['_element.html']);
done();
});
});
开发者ID:Polymer,项目名称:tools,代码行数:7,代码来源:element_test.ts
示例2: test
test(testName, (done) => {
let getSemverReleaseStub: sinon.SinonStub;
let extractReleaseTarballStub: sinon.SinonStub;
const TestGenerator = createTestGenerator(
{
owner: 'Polymer',
repo: 'shop',
},
function setupGeneratorStubs(generator) {
getSemverReleaseStub =
// tslint:disable-next-line: no-any
sinon.stub((generator as any)._github, 'getSemverRelease')
.returns(Promise.resolve(semverMatchingRelease));
extractReleaseTarballStub =
// tslint:disable-next-line: no-any
sinon.stub((generator as any)._github, 'extractReleaseTarball')
.returns(Promise.resolve());
});
// tslint:disable-next-line: no-any
helpers.run(TestGenerator as any).on('end', () => {
assert.isOk(getSemverReleaseStub.calledWith('*'));
assert.isOk(extractReleaseTarballStub.calledWith(
semverMatchingRelease.tarball_url));
done();
});
});
开发者ID:MehdiRaash,项目名称:tools,代码行数:28,代码来源:github_test.ts
示例3: test
test(testName, (done) => {
const testSemverRange = '^v123.456.789';
let getSemverReleaseStub: sinon.SinonStub;
let extractReleaseTarballStub: sinon.SinonStub;
const TestGenerator = createTestGenerator(
{
owner: 'Polymer',
repo: 'shop',
semverRange: testSemverRange,
},
function setupGeneratorStubs(generator) {
const {_github} = generator as unknown as {
_github:
{getSemverRelease: unknown, extractReleaseTarball: unknown}
};
getSemverReleaseStub =
// tslint:disable-next-line: no-any
sinon.stub(_github, 'getSemverRelease')
.returns(Promise.resolve(semverMatchingRelease));
extractReleaseTarballStub =
// tslint:disable-next-line: no-any
sinon.stub(_github, 'extractReleaseTarball')
.returns(Promise.resolve());
});
// tslint:disable-next-line: no-any
helpers.run(TestGenerator as any).on('end', () => {
assert.isOk(getSemverReleaseStub.calledWith(testSemverRange));
assert.isOk(extractReleaseTarballStub.calledWith(
semverMatchingRelease.tarball_url));
done();
});
});
开发者ID:Polymer,项目名称:tools,代码行数:34,代码来源:github_test.ts
示例4: createApplicationGenerator
(done) => {
const TestGenerator = createApplicationGenerator('polymer-1.x');
helpers.run(TestGenerator).on('end', () => {
yoAssert.noFile(['src/_element/_element.html']);
done();
});
});
开发者ID:abdonrd,项目名称:polymer-cli,代码行数:7,代码来源:application_test.ts
示例5:
(resolve, reject): void => {
this.runContext = helpers
.run(path.join(__dirname, `../../../generators/${name}`), {
tmpdir: false
})
.inDir(scratchDir)
.withArguments(args)
.withPrompts(prompt)
.on(
"ready",
// We don't want to import any source statically, so can't import
// type BaseGenerator
// @ts-ignore
(generator): void => {
// .yo-rc.json is in topdir and yeoman-test silently resets
// cwd to topdir (because of sinonjs masking the warning)
// so override the reset
generator.destinationRoot(scratchDir);
// Also override the reset for every single subgen
// @ts-ignore
generator._composedWith.forEach(
// We don't want to import any source statically, so can't import
// type BaseGenerator
// @ts-ignore
(gen): void => {
gen.destinationRoot(scratchDir);
}
);
}
)
.on("end", resolve)
.on("error", reject)
.toPromise();
}
开发者ID:jlenoble,项目名称:generator-wupjs,代码行数:35,代码来源:test-generator.ts
示例6: skipOnWindows
skipOnWindows('test the Polymer 1.x "element" template', async () => {
const dir =
await runGenerator(createElementGenerator('polymer-1.x'))
.withPrompts({name: 'my-element'}) // Mock the prompt answers
.toPromise();
await runCommand(binPath, ['install'], {cwd: dir});
await runCommand(binPath, ['lint'], {cwd: dir});
await runCommand(binPath, ['test'], {cwd: dir});
});
开发者ID:poehlmann,项目名称:EvaluacionDiferencialDeLaMemoria,代码行数:9,代码来源:integration_test.ts
示例7: suiteSetup
suiteSetup(async () => {
const TSPGenerator = createGithubGenerator({
owner: 'Polymer',
repo: 'tools-sample-projects',
githubToken,
});
tspDir = await runGenerator(TSPGenerator).toPromise();
});
开发者ID:poehlmann,项目名称:EvaluacionDiferencialDeLaMemoria,代码行数:9,代码来源:integration_test.ts
注:本文中的yeoman-test.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论