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

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

    expect(tree.files).toEqual([]);
  });
Exemplo n.º 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']);
  });
Exemplo n.º 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();