-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated yarn lock and deps for schematics
- Loading branch information
1 parent
bd831fe
commit 4f5cc53
Showing
9 changed files
with
1,045 additions
and
224 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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { Tree } from '@angular-devkit/schematics'; | ||
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; | ||
|
||
|
||
/** Create a base app used for testing. */ | ||
export function createTestApp(runner: SchematicTestRunner, appOptions = {}): UnitTestTree { | ||
export async function createTestApp(runner: SchematicTestRunner, appOptions = {}, tree?: Tree): | ||
Promise<UnitTestTree> { | ||
const workspaceTree = runner.runExternalSchematic('@schematics/angular', 'workspace', { | ||
name: 'workspace', | ||
version: '7.0.0', | ||
version: '8.0.0', | ||
newProjectRoot: 'projects' | ||
}); | ||
}, tree); | ||
|
||
return runner.runExternalSchematic('@schematics/angular', 'application', | ||
{...appOptions, name: 'mosaic'}, workspaceTree); | ||
return runner.runExternalSchematicAsync('@schematics/angular', 'application', | ||
{name: 'material', ...appOptions}, workspaceTree).toPromise(); | ||
} | ||
|
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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
// import { Tree } from '@angular-devkit/schematics'; | ||
// import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; | ||
// import { createTestApp } from '@ptsecurity/cdk/schematics'; | ||
// import { removePackageJsonDependency } from '@schematics/angular/utility/dependencies'; | ||
// import { getFileContent } from '@schematics/angular/utility/test'; | ||
// | ||
// | ||
// xdescribe('ng-add schematic', () => { | ||
// | ||
// let runner: SchematicTestRunner; | ||
// let appTree: Tree; | ||
// | ||
// beforeEach(async () => { | ||
// runner = new SchematicTestRunner('schematics', require.resolve('../collection.json')); | ||
// appTree = await createTestApp(runner); | ||
// }); | ||
// | ||
// it('should update package.json', async () => { | ||
// | ||
// removePackageJsonDependency(appTree, '@angular/animations'); | ||
// | ||
// const tree = await runner.runSchematicAsync('ng-add', {}, appTree).toPromise(); | ||
// const packageJson = JSON.parse(getFileContent(tree, '/package.json')); | ||
// const dependencies = packageJson.dependencies; | ||
// const angularCoreVersion = dependencies['@angular/core']; | ||
// | ||
// expect(dependencies['@angular/cdk']).toBeDefined(); | ||
// expect(dependencies['@ptsecurity/mosaic']).toBeDefined(); | ||
// expect(dependencies['@angular/forms']) | ||
// .toBe( | ||
// angularCoreVersion, | ||
// 'Expected the @angular/forms package to have the same version as @angular/core.'); | ||
// expect(dependencies['@angular/animations']) | ||
// .toBe( | ||
// angularCoreVersion, | ||
// 'Expected the @angular/animations package to have the same version as @angular/core.'); | ||
// | ||
// expect(Object.keys(dependencies)) | ||
// .toEqual( | ||
// Object.keys(dependencies).sort(), | ||
// 'Expected the modified "dependencies" to be sorted alphabetically.'); | ||
// | ||
// expect(runner.tasks.some((task) => task.name === 'run-schematic')).toBe(true); | ||
// }); | ||
// }); |
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
Oops, something went wrong.