feat(dev-infra): introduce validators for ng-dev config loading (#37049)

Introduces infrastructure to validate configuration of the ng-dev
command at run time.  Allowing for errors to be returned to the
user running the command.

PR Close #37049
This commit is contained in:
Joey Perrott
2020-05-08 14:51:29 -07:00
committed by Misko Hevery
parent d113bfa14f
commit 4f1b7a4a6a
7 changed files with 119 additions and 46 deletions

View File

@ -7,11 +7,9 @@
*/
// Imports
import * as utilConfig from '../utils/config';
import * as validateConfig from './config';
import {validateCommitMessage} from './validate';
// Constants
const config = {
'commitMessage': {
@ -46,7 +44,7 @@ describe('validate-commit-message.js', () => {
lastError = '';
spyOn(console, 'error').and.callFake((msg: string) => lastError = msg);
spyOn(utilConfig, 'getAngularDevConfig').and.returnValue(config);
spyOn(validateConfig, 'getCommitMessageConfig').and.returnValue(config);
});
describe('validateMessage()', () => {