forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@angular/cli): update tslint on updating prefix (angular#5908)
Fixes angular#5794
- Loading branch information
1 parent
6c98432
commit 59dffc4
Showing
4 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {ng} from '../../../utils/process'; | ||
import {expectToFail} from '../../../utils/utils'; | ||
import * as fs from 'fs'; | ||
|
||
export default function() { | ||
return Promise.resolve() | ||
.then(() => expectToFail(() => ng('set', 'apps.zzz.prefix'))) | ||
.then(() => ng('set', 'apps.0.prefix' , 'new-prefix')) | ||
.then(() => ng('get', 'apps.0.prefix')) | ||
.then(({ stdout }) => { | ||
if (!stdout.match(/new-prefix/)) { | ||
throw new Error(`Expected "new-prefix", received "${JSON.stringify(stdout)}".`); | ||
} | ||
}) | ||
.then(() => { | ||
const tsLint = JSON.parse(fs.readFileSync(process.cwd() + '/tslint.json', 'utf8')); | ||
if (tsLint.rules['component-selector'][2] !== 'new-prefix') { | ||
throw new Error(`Expected "new-prefix" Found: ${tsLint.rules['component-selector'][2]}.`); | ||
} | ||
}); | ||
} |