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']);
  });
Example #2
0
  it('works', () => {
    const runner = new SchematicTestRunner('schematics', collectionPath);
    const tree = runner.runSchematic('add', {
      module: 'app'
    }, Tree.empty());

    expect(tree.files).toEqual(['/hello']);
  });
Example #3
0
    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}`
      );
    });
Example #4
0
 beforeEach(() => {
   tree = Tree.empty() as UnitTestTree;
   tree.create('/package.json', `{}`);
 });
Example #5
0
  it('works', () => {
    const runner = new SchematicTestRunner('schematics', collectionPath);
    const tree = runner.runSchematic('new-component', {}, Tree.empty());

    expect(tree.files).toEqual([]);
  });
Example #6
0
  it('works', () => {
    const runner = new SchematicTestRunner('schematics', collectionPath);
    const tree = runner.runSchematic('my-other-schematic', {}, Tree.empty());

    expect(tree.files.sort()).toEqual(['/allo', '/hola']);
  });
Example #7
0
  it('works', () => {
    const runner = new SchematicTestRunner('schematics', collectionPath);
    const tree = runner.runSchematic('<%= dasherize(name) %>', {}, Tree.empty());

    expect(tree.files).toEqual([]);
  });
 expect(() => runner.runSchematic('my-full-schematic', {}, Tree.empty())).toThrow();