-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Schematcis): Extend from @schematics/angular
BREAKING CHANGE: NgRx Schematics now has a minimum version dependency on @angular-devkit/core and @angular-devkit/schematics of v0.4.0.
- Loading branch information
1 parent
bd415a1
commit 0e17aad
Showing
3 changed files
with
34 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Tree, VirtualTree } from '@angular-devkit/schematics'; | ||
import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; | ||
import * as path from 'path'; | ||
import { createAppModule, getFileContent } from './utility/test'; | ||
|
||
describe('CLI Schematic', () => { | ||
const schematicRunner = new SchematicTestRunner( | ||
'@ngrx/schematics', | ||
path.join(__dirname, '../collection.json') | ||
); | ||
const defaultOptions = { | ||
name: 'foo', | ||
}; | ||
|
||
let appTree: Tree; | ||
|
||
beforeEach(() => { | ||
appTree = new VirtualTree(); | ||
appTree = createAppModule(appTree); | ||
}); | ||
|
||
it('should create a class by the angular/cli', () => { | ||
const options = { ...defaultOptions, state: undefined }; | ||
const tree = schematicRunner.runSchematic('class', options, appTree); | ||
const content = getFileContent(tree, '/src/app/foo.ts'); | ||
expect(content).toMatch(/export class Foo/); | ||
}); | ||
}); |