fix(nx): correct path of TSLint config. Fixes #1435

This change:
- fixes path in TSLint config template
- add tests coverage for creation and content of the library
`tslint.json` configuration file

Thanks!
This commit is contained in:
Peter Blazejewicz 2019-06-02 14:35:49 +02:00 committed by Victor Savkin
parent 872e969fe4
commit e65993f005
2 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ {
"extends": "<%= offsetFromRoot %>/tslint.json", "extends": "<%= offsetFromRoot %>tslint.json",
"rules": [] "rules": []
} }

View File

@ -150,6 +150,8 @@ describe('lib', () => {
expect( expect(
tree.exists('libs/my-dir/my-lib/src/lib/my-dir-my-lib.ts') tree.exists('libs/my-dir/my-lib/src/lib/my-dir-my-lib.ts')
).toBeTruthy(); ).toBeTruthy();
expect(tree.exists('libs/my-dir/my-lib/src/index.ts')).toBeTruthy();
expect(tree.exists(`libs/my-dir/my-lib/tslint.json`)).toBeTruthy();
}); });
it('should update angular.json', async () => { it('should update angular.json', async () => {
@ -209,6 +211,20 @@ describe('lib', () => {
include: ['**/*.ts'] include: ['**/*.ts']
}); });
}); });
it('should create a local tslint.json', async () => {
const tree = await runSchematic(
'lib',
{ name: 'myLib', directory: 'myDir' },
appTree
);
const tslintJson = readJsonInTree(tree, 'libs/my-dir/my-lib/tslint.json');
expect(tslintJson).toEqual({
extends: '../../../tslint.json',
rules: []
});
});
}); });
describe('--unit-test-runner none', () => { describe('--unit-test-runner none', () => {