mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-21 14:02:43 +08:00
test: Remove refs to service schematic module option
This commit is contained in:
parent
f5c014ba52
commit
99744de5c4
@ -34,7 +34,7 @@ export default function () {
|
||||
// Enable default option and generate all other module related blueprints
|
||||
.then(() => ng('config', 'defaults.lintFix', 'true'))
|
||||
.then(() => ng('generate', 'directive', 'test-directive'))
|
||||
.then(() => ng('generate', 'service', 'test-service', '--module', 'app.module.ts'))
|
||||
.then(() => ng('generate', 'service', 'test-service'))
|
||||
.then(() => ng('generate', 'pipe', 'test-pipe'))
|
||||
.then(() => ng('generate', 'guard', 'test-guard', '--module', 'app.module.ts'))
|
||||
.then(() => ng('lint'));
|
||||
|
@ -10,9 +10,8 @@ export default function() {
|
||||
return ng('generate', 'service', 'test-service')
|
||||
.then(() => expectFileToExist(serviceDir))
|
||||
.then(() => expectFileToExist(join(serviceDir, 'test-service.service.ts')))
|
||||
.then(() => expectFileToExist(join(serviceDir, 'test-service.service.spec.ts')));
|
||||
.then(() => expectFileToExist(join(serviceDir, 'test-service.service.spec.ts')))
|
||||
|
||||
// Try to run the unit tests.
|
||||
// TODO: re-enable when updated to Angular v6
|
||||
// .then(() => ng('test', '--watch=false'));
|
||||
.then(() => ng('test', '--watch=false'));
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
import {ng} from '../../../utils/process';
|
||||
import {expectGitToBeClean} from '../../../utils/git';
|
||||
|
||||
|
||||
export default function() {
|
||||
return ng('generate', 'service', 'test-service', '--module', 'app.module.ts', '--dry-run')
|
||||
.then(({stdout}) => {
|
||||
if (!/NOTE: Run with "dry run" no changes were made/.test(stdout)) {
|
||||
throw 'Dry run warning not shown.';
|
||||
}
|
||||
})
|
||||
.then(() => expectGitToBeClean());
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
import {ng} from '../../../utils/process';
|
||||
import {expectToFail} from '../../../utils/utils';
|
||||
|
||||
|
||||
export default function() {
|
||||
return Promise.resolve()
|
||||
.then(() => expectToFail(() =>
|
||||
ng('generate', 'service', 'test-service', '--module', 'app.moduleXXX.ts')));
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
import {join} from 'path';
|
||||
import {ng} from '../../../utils/process';
|
||||
import {expectFileToMatch} from '../../../utils/fs';
|
||||
|
||||
|
||||
// tslint:disable:max-line-length
|
||||
export default function() {
|
||||
const servicePath = join('src', 'app', 'test-service.service.ts');
|
||||
const service2Path = join('src', 'app', 'test-service2.service.ts');
|
||||
|
||||
return ng('generate', 'service', 'test-service', '--module', 'app.module.ts')
|
||||
.then(() => expectFileToMatch(servicePath, /import { AppModule } from '.\/app.module'/))
|
||||
.then(() => expectFileToMatch(servicePath, /providedIn: AppModule/))
|
||||
|
||||
.then(() => process.chdir(join('src', 'app')))
|
||||
.then(() => ng('generate', 'service', 'test-service2', '--module', 'app.module.ts'))
|
||||
.then(() => process.chdir('../..'))
|
||||
.then(() => expectFileToMatch(service2Path, /import { AppModule } from '.\/app.module'/))
|
||||
.then(() => expectFileToMatch(service2Path, /providedIn: AppModule/))
|
||||
.then(() => ng('build'));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user