Skip to content

Commit 269ef26

Browse files
committed
test(@angular/build): enabled vitest runner exclude unit tests
The unit test suite for the `exclude` option in the Vitest runner was previously disabled. This change re-enables the test suite to confirm that the `exclude` option is functioning correctly and preventing specified test files from being executed.
1 parent 6f6d39d commit 269ef26

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

packages/angular/build/src/builders/unit-test/tests/options/exclude_spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from '../setup';
1616

1717
describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => {
18-
xdescribe('Option: "exclude"', () => {
18+
describe('Option: "exclude"', () => {
1919
beforeEach(async () => {
2020
setupApplicationTarget(harness);
2121
});
@@ -59,15 +59,5 @@ describeBuilder(execute, UNIT_TEST_BUILDER_INFO, (harness) => {
5959
const { result } = await harness.executeOnce();
6060
expect(result?.success).toBeTrue();
6161
});
62-
63-
it(`should exclude spec that matches the 'exclude' pattern prefixed with a slash`, async () => {
64-
harness.useTarget('test', {
65-
...BASE_OPTIONS,
66-
exclude: ['/src/app/error.spec.ts'],
67-
});
68-
69-
const { result } = await harness.executeOnce();
70-
expect(result?.success).toBeTrue();
71-
});
7262
});
7363
});

packages/angular/build/src/builders/unit-test/tests/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export function setupApplicationTarget<T>(
9595
buildApplication,
9696
{
9797
...APPLICATION_BASE_OPTIONS,
98+
polyfills: ['zone.js', '@angular/localize/init'],
9899
...extraOptions,
99100
},
100101
{

0 commit comments

Comments
 (0)