Skip to content

Commit

Permalink
feat(@schematics/angular): enable error on unknown properties and ele…
Browse files Browse the repository at this point in the history
…ments 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.
  • Loading branch information
cexbrayat authored and dgp1130 committed Sep 16, 2022
1 parent 074c7cb commit 1c21e47
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Expand Up @@ -23,10 +23,10 @@ declare const require: {
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
errorOnUnknownElements: true,
errorOnUnknownProperties: true
});
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
Expand Down
Expand Up @@ -24,10 +24,10 @@ declare const require: {
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
errorOnUnknownElements: true,
errorOnUnknownProperties: true
});
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
Expand Down
Expand Up @@ -15,10 +15,10 @@ declare const require: {
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
errorOnUnknownElements: true,
errorOnUnknownProperties: true
});

// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
Expand Up @@ -16,10 +16,10 @@ declare const require: {
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
errorOnUnknownElements: true,
errorOnUnknownProperties: true
});

// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down

0 comments on commit 1c21e47

Please sign in to comment.