Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! fix(@angular/build): prevent deleting parent directories of pr…
…oject root
  • Loading branch information
pradhankukiran authored and alan-agius4 committed Mar 27, 2026
commit 6c745ccb202a5d06c038ddc6a3f1317bc4ed1230
7 changes: 2 additions & 5 deletions packages/angular/build/src/utils/delete-output-dir_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
* found in the LICENSE file at https://angular.dev/license
*/

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

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

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

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

await deleteOutputDir(root, 'dist');

Comment thread
alan-agius4 marked this conversation as resolved.
const { readdir } = await import('node:fs/promises');
const entries = await readdir(outputDir);
expect(entries.length).toBe(0);
});
Expand Down
Loading