-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add declaration-property-value-no-unknown via ng update (#…
- Loading branch information
Showing
4 changed files
with
60 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
- [ ] add `declaration-property-value-no-unknown` in `.stylelintrc.js` | ||
- |
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,34 @@ | ||
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; | ||
|
||
import { tryAddFile } from '../../../utils'; | ||
import { createAlainApp, migrationCollection } from '../../../utils/testing'; | ||
|
||
describe('Schematic: ng-update: v19Rule', () => { | ||
let runner: SchematicTestRunner; | ||
let tree: UnitTestTree; | ||
const logs: string[] = []; | ||
|
||
beforeEach(async () => { | ||
({ runner, tree } = await createAlainApp()); | ||
}); | ||
|
||
async function runMigration(): Promise<void> { | ||
logs.length = 0; | ||
runner = new SchematicTestRunner('schematics', migrationCollection); | ||
runner.logger.subscribe(e => logs.push(e.message)); | ||
await runner.runSchematic('migration-v19', {}, tree); | ||
} | ||
|
||
it('add declaration-property-value-no-unknown', async () => { | ||
const filePath = '/.stylelintrc.js'; | ||
tryAddFile( | ||
tree, | ||
filePath, | ||
` 'media-query-no-invalid': null, | ||
'order/order': [` | ||
); | ||
await runMigration(); | ||
const content = tree.readContent(filePath); | ||
expect(content).toContain(`declaration-property-value-no-unknown`); | ||
}); | ||
}); |
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