mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 19:13:34 +08:00
feat(@schematics/angular): enable error on unknown properties and elements in tests
These new options have been introduced in Angular v14. The commit enables the option in a new project, as we did when we introduced the `destroyAfterOption`, with the same long term goal to have these options enabled by default.
This commit is contained in:
parent
074c7cb97c
commit
1c21e470c7
@ -23,10 +23,10 @@ declare const require: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
||||||
BrowserDynamicTestingModule,
|
errorOnUnknownElements: true,
|
||||||
platformBrowserDynamicTesting(),
|
errorOnUnknownProperties: true
|
||||||
);
|
});
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
// And load the modules.
|
// And load the modules.
|
||||||
|
@ -24,10 +24,10 @@ declare const require: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
||||||
BrowserDynamicTestingModule,
|
errorOnUnknownElements: true,
|
||||||
platformBrowserDynamicTesting(),
|
errorOnUnknownProperties: true
|
||||||
);
|
});
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
// And load the modules.
|
// And load the modules.
|
||||||
|
@ -15,10 +15,10 @@ declare const require: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
||||||
BrowserDynamicTestingModule,
|
errorOnUnknownElements: true,
|
||||||
platformBrowserDynamicTesting(),
|
errorOnUnknownProperties: true
|
||||||
);
|
});
|
||||||
|
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
|
@ -16,10 +16,10 @@ declare const require: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
|
||||||
BrowserDynamicTestingModule,
|
errorOnUnknownElements: true,
|
||||||
platformBrowserDynamicTesting(),
|
errorOnUnknownProperties: true
|
||||||
);
|
});
|
||||||
|
|
||||||
// Then we find all the tests.
|
// Then we find all the tests.
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
const context = require.context('./', true, /\.spec\.ts$/);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user