Skip to content

Commit 38130b7

Browse files
fix(@angular/build): use static imports in delete-output-dir tests
Move dynamic imports of node:fs/promises and node:os to static imports at the top of the file for consistency.
1 parent 1232d2d commit 38130b7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/angular/build/src/utils/delete-output-dir_spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import { mkdir, writeFile } from 'node:fs/promises';
9+
import { mkdir, mkdtemp, readdir, writeFile } from 'node:fs/promises';
10+
import { tmpdir } from 'node:os';
1011
import { join } from 'node:path';
1112
import { deleteOutputDir } from './delete-output-dir';
1213

1314
describe('deleteOutputDir', () => {
1415
let root: string;
1516

1617
beforeEach(async () => {
17-
// Use a unique temp directory for each test
18-
const { mkdtemp } = await import('node:fs/promises');
19-
const { tmpdir } = await import('node:os');
2018
root = await mkdtemp(join(tmpdir(), 'ng-test-'));
2119
});
2220

@@ -53,7 +51,6 @@ describe('deleteOutputDir', () => {
5351

5452
await deleteOutputDir(root, 'dist');
5553

56-
const { readdir } = await import('node:fs/promises');
5754
const entries = await readdir(outputDir);
5855
expect(entries.length).toBe(0);
5956
});

0 commit comments

Comments
 (0)