Skip to content

Commit

Permalink
[Tests] node v21.3 has a broken fs.writeFile
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 4, 2023
1 parent e67259e commit 8c83eaf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/src/rules/no-unused-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ describe('renameDefault', () => {

describe('test behavior for new file', () => {
before(() => {
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-0.js'), '', { encoding: 'utf8' });
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-0.js'), '', { encoding: 'utf8', flag: 'w' });
});

// add import in newly created file
Expand Down Expand Up @@ -840,7 +840,7 @@ describe('test behavior for new file', () => {

describe('test behavior for new file', () => {
before(() => {
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-1.js'), '', { encoding: 'utf8' });
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-1.js'), '', { encoding: 'utf8', flag: 'w' });
});
ruleTester.run('no-unused-modules', rule, {
valid: [
Expand Down Expand Up @@ -875,7 +875,7 @@ describe('test behavior for new file', () => {

describe('test behavior for new file', () => {
before(() => {
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-2.js'), '', { encoding: 'utf8' });
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-2.js'), '', { encoding: 'utf8', flag: 'w' });
});
ruleTester.run('no-unused-modules', rule, {
valid: [
Expand All @@ -901,7 +901,7 @@ describe('test behavior for new file', () => {

describe('test behavior for new file', () => {
before(() => {
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-3.js'), '', { encoding: 'utf8' });
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-3.js'), '', { encoding: 'utf8', flag: 'w' });
});
ruleTester.run('no-unused-modules', rule, {
valid: [
Expand Down Expand Up @@ -952,7 +952,7 @@ describe('test behavior for destructured exports', () => {

describe('test behavior for new file', () => {
before(() => {
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-4.js.js'), '', { encoding: 'utf8' });
fs.writeFileSync(testFilePath('./no-unused-modules/file-added-4.js.js'), '', { encoding: 'utf8', flag: 'w' });
});
ruleTester.run('no-unused-modules', rule, {
valid: [
Expand Down

0 comments on commit 8c83eaf

Please sign in to comment.