How to use the @nrwl/workspace/testing.createEmptyWorkspace function in @nrwl/workspace

To help you get started, weโ€™ve selected a few @nrwl/workspace examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nrwl / nx / packages / storybook / src / utils / testing.ts View on Github external
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`,
    `
github nrwl / nx / packages / angular / src / schematics / ngrx / ngrx.spec.ts View on Github external
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 => {
github nrwl / nx / packages / angular / src / schematics / init / init.spec.ts View on Github external
beforeEach(() => {
    appTree = createEmptyWorkspace(Tree.empty());
  });
github nrwl / nx / packages / web / src / schematics / application / application.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createEmptyWorkspace(appTree);
  });
github nrwl / nx / packages / nest / src / schematics / application / application.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createEmptyWorkspace(appTree);
  });
github nrwl / nx / packages / express / src / schematics / init / init.spec.ts View on Github external
beforeEach(() => {
    tree = Tree.empty();
    tree = createEmptyWorkspace(tree);
    testRunner = new SchematicTestRunner(
      '@nrwl/express',
      join(__dirname, '../../../collection.json')
    );
  });
github nrwl / nx / packages / express / src / schematics / application / application.spec.ts View on Github external
beforeEach(() => {
    appTree = Tree.empty();
    appTree = createEmptyWorkspace(appTree);
  });
github nrwl / nx / packages / react / src / migrations / update-8-10-0 / update-8-10-0.spec.ts View on Github external
beforeEach(async () => {
    tree = Tree.empty();
    tree = createEmptyWorkspace(tree);
    schematicRunner = new SchematicTestRunner(
      '@nrwl/react',
      path.join(__dirname, '../../../migrations.json')
    );
  });
github nrwl / nx / packages / schematics / migrations / update-7-7-0 / update-7-7-0.spec.ts View on Github external
beforeEach(() => {
    initialTree = createEmptyWorkspace(Tree.empty());

    schematicRunner = new SchematicTestRunner(
      '@nrwl/schematics',
      join(__dirname, '../migrations.json')
    );
  });
github nrwl / nx / packages / schematics / migrations / update-7-5-0 / update-7-5-0.spec.ts View on Github external
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')
    );
  });