Skip to content

Commit

Permalink
fix(nest): remove the default main file from @nrwl/node:lib (#2920)
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed May 5, 2020
1 parent 5eca6d5 commit fcc0782
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/nest/src/schematics/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ describe('lib', () => {
);
});

it('should remove the default file from @nrwl/node:lib', async () => {
const tree = await runSchematic(
'lib',
{ name: 'myLib', global: true },
appTree
);
expect(tree.exists('libs/my-lib/src/lib/my-lib.spec.ts')).toBeFalsy();
expect(tree.exists('libs/my-lib/src/lib/my-lib.ts')).toBeFalsy();
});

it('should provide the controller and service', async () => {
const tree = await runSchematic(
'lib',
Expand Down
1 change: 1 addition & 0 deletions packages/nest/src/schematics/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function (schema: NormalizedSchema): Rule {
addProject(options),
formatFiles(options),
deleteFile(`/${options.projectRoot}/src/lib/${options.fileName}.spec.ts`),
deleteFile(`/${options.projectRoot}/src/lib/${options.fileName}.ts`),
]);
};
}
Expand Down

0 comments on commit fcc0782

Please sign in to comment.