test: Remove refs to service schematic module option

This commit is contained in:
Mike Brocchi 2018-04-12 12:17:43 -04:00 committed by Hans
parent f5c014ba52
commit 99744de5c4
5 changed files with 3 additions and 47 deletions

View File

@ -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'));

View File

@ -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'));
}

View File

@ -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());
}

View File

@ -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')));
}

View File

@ -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'));
}