Skip to content

fix: replace require('fs') with ESM import in e2e build tests#3284

Merged
kamilmysliwiec merged 2 commits intov12.0.0from
copilot/sub-pr-3280-another-one
Mar 11, 2026
Merged

fix: replace require('fs') with ESM import in e2e build tests#3284
kamilmysliwiec merged 2 commits intov12.0.0from
copilot/sub-pr-3280-another-one

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 11, 2026

test/e2e/build.command.e2e-spec.ts runs under ESM ("type": "module"), where require is not defined. Both cleanDist() functions used const fs = require('fs') inline, causing them to throw at runtime.

Changes

  • Added top-level import * as fs from 'fs' to the test file
  • Removed inline const fs = require('fs') from both cleanDist() functions
+ import * as fs from 'fs';

  function cleanDist() {
-   const fs = require('fs');
    fs.rmSync(path.join(appPath, 'dist'), { recursive: true, force: true });
  }

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from PR #3280 on major release changes fix: replace require('fs') with ESM import in e2e build tests Mar 11, 2026
@kamilmysliwiec kamilmysliwiec marked this pull request as ready for review March 11, 2026 15:00
@kamilmysliwiec kamilmysliwiec merged commit a22584b into v12.0.0 Mar 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants