本文整理汇总了TypeScript中@angular-devkit/schematics.Tree.empty方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Tree.empty方法的具体用法?TypeScript Tree.empty怎么用?TypeScript Tree.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular-devkit/schematics.Tree
的用法示例。
在下文中一共展示了Tree.empty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('works', () => {
const runner = new SchematicTestRunner('schematics', collectionPath);
const tree = runner.runSchematic('my-full-schematic', { required: 'str' }, Tree.empty());
// Listing files
expect(tree.files.sort()).toEqual(['/allo', '/hola']);
});
示例2: it
it('works', () => {
const runner = new SchematicTestRunner('schematics', collectionPath);
const tree = runner.runSchematic('add', {
module: 'app'
}, Tree.empty());
expect(tree.files).toEqual(['/hello']);
});
示例3: it
it(`should install version ${prefix}6.0.0`, () => {
appTree = new UnitTestTree(Tree.empty());
const runner = new SchematicTestRunner('schematics', collectionPath);
const tree = createPackageJson(prefix, pkgName, appTree);
const newTree = runner.runSchematic(
`ngrx-${pkgName}-migration-01`,
{},
tree
);
const pkg = JSON.parse(newTree.readContent(packagePath));
expect(pkg.dependencies[`@ngrx/${pkgName}`]).toBe(
`${prefix}${upgradeVersion}`
);
});
示例4: beforeEach
beforeEach(() => {
tree = Tree.empty() as UnitTestTree;
tree.create('/package.json', `{}`);
});
示例5: it
it('works', () => {
const runner = new SchematicTestRunner('schematics', collectionPath);
const tree = runner.runSchematic('new-component', {}, Tree.empty());
expect(tree.files).toEqual([]);
});
示例6: it
it('works', () => {
const runner = new SchematicTestRunner('schematics', collectionPath);
const tree = runner.runSchematic('my-other-schematic', {}, Tree.empty());
expect(tree.files.sort()).toEqual(['/allo', '/hola']);
});
示例7: expect
expect(() => runner.runSchematic('my-full-schematic', {}, Tree.empty())).toThrow();