Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function createTestUILib(libName: string): Promise {
let appTree = Tree.empty();
appTree = createEmptyWorkspace(appTree);
appTree = await callRule(
externalSchematic('@nrwl/angular', 'library', {
name: libName
}),
appTree
);
appTree = await callRule(
externalSchematic('@nrwl/angular', 'component', {
name: 'test-button',
project: libName
}),
appTree
);
appTree.overwrite(
`libs/${libName}/src/lib/test-button/test-button.component.ts`,
`
it('should use DataPersistence operators when useDataPersistence is set to false', async () => {
appTree = Tree.empty();
appTree = createEmptyWorkspace(appTree);
appTree = createApp(appTree, 'myapp');
const tree = await runSchematic(
'ngrx',
{
name: 'users',
module: appConfig.appModule,
syntax: 'creators',
facade: true,
useDataPersistence: false
},
appTree
);
const content = tree.readContent(`${statePath}/users.effects.ts`);
[`{ fetch }`, `, ofType`, `ofType(UsersActions.loadUsers),`].forEach(
text => {
beforeEach(() => {
appTree = createEmptyWorkspace(Tree.empty());
});
beforeEach(() => {
appTree = Tree.empty();
appTree = createEmptyWorkspace(appTree);
});
beforeEach(() => {
appTree = Tree.empty();
appTree = createEmptyWorkspace(appTree);
});
beforeEach(() => {
tree = Tree.empty();
tree = createEmptyWorkspace(tree);
testRunner = new SchematicTestRunner(
'@nrwl/express',
join(__dirname, '../../../collection.json')
);
});
beforeEach(() => {
appTree = Tree.empty();
appTree = createEmptyWorkspace(appTree);
});
beforeEach(async () => {
tree = Tree.empty();
tree = createEmptyWorkspace(tree);
schematicRunner = new SchematicTestRunner(
'@nrwl/react',
path.join(__dirname, '../../../migrations.json')
);
});
beforeEach(() => {
initialTree = createEmptyWorkspace(Tree.empty());
schematicRunner = new SchematicTestRunner(
'@nrwl/schematics',
join(__dirname, '../migrations.json')
);
});
beforeEach(() => {
initialTree = createEmptyWorkspace(Tree.empty());
initialTree.overwrite(
'package.json',
serializeJson({
devDependencies: {
typescript: '~3.1.0'
}
})
);
schematicRunner = new SchematicTestRunner(
'@nrwl/schematics',
path.join(__dirname, '../migrations.json')
);
});