Skip to content

Commit

Permalink
Merge branch 'main' into eslint-js-recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg authored Jan 2, 2025
2 parents ed6710a + 75dcf8c commit 4a59df3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
os: 'ubuntu-latest,windows-latest'
# The 22.11.0 is instead of 22 per /~https://github.com/mochajs/mocha/issues/5278
node-versions: '14,16,18,20,22.11.0'
node-versions: '18,20,22.11.0'
npm-script: test-node:${{ matrix.test-part }}
coverage: ${{ matrix.coverage }}

Expand Down
26 changes: 0 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"cross-env": "^7.0.2",
"eslint": "^8.56.0",
"fail-on-errors-webpack-plugin": "^3.0.0",
"fs-extra": "^10.0.0",
"globals": "^13.24.0",
"installed-check": "^9.3.0",
"jsdoc": "^3.6.7",
Expand Down
13 changes: 7 additions & 6 deletions test/integration/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

const escapeRegExp = require('escape-string-regexp');
const os = require('os');
const fs = require('fs-extra');
const fs = require('fs');
const fsP = require('fs/promises');
const {format} = require('util');
const path = require('path');
const Base = require('../../lib/reporters/base');
Expand Down Expand Up @@ -487,7 +488,7 @@ const touchRef = new Date();
* @param {string} filepath - Path to file
*/
function touchFile(filepath) {
fs.ensureDirSync(path.dirname(filepath));
fs.mkdirSync(path.dirname(filepath), { recursive: true });
try {
fs.utimesSync(filepath, touchRef, touchRef);
} catch (e) {
Expand Down Expand Up @@ -519,21 +520,21 @@ function replaceFileContents(filepath, pattern, replacement) {
*/
function copyFixture(fixtureName, dest) {
const fixtureSource = resolveFixturePath(fixtureName);
fs.ensureDirSync(path.dirname(dest));
fs.copySync(fixtureSource, dest);
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.cpSync(fixtureSource, dest);
}

/**
* Creates a temporary directory
* @returns {Promise<CreateTempDirResult>} Temp dir path and cleanup function
*/
const createTempDir = async () => {
const dirpath = await fs.mkdtemp(path.join(os.tmpdir(), 'mocha-'));
const dirpath = await fsP.mkdtemp(path.join(os.tmpdir(), 'mocha-'));
return {
dirpath,
removeTempDir: async () => {
if (!process.env.MOCHA_TEST_KEEP_TEMP_DIRS) {
return fs.remove(dirpath);
return fs.rmSync(dirpath, { recursive: true, force: true });
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions test/integration/options/watch.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const fs = require('fs-extra');
const fs = require('fs');
const path = require('path');
const {
copyFixture,
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('--watch', function () {
[testFile, '--watch-files', 'lib/**/*.xyz'],
tempDir,
() => {
fs.removeSync(watchedFile);
fs.rmSync(watchedFile, { recursive: true, force: true });
}
).then(results => {
expect(results, 'to have length', 2);
Expand Down

0 comments on commit 4a59df3

Please sign in to comment.