Skip to content

Commit 42a5095

Browse files
Use renameFile from move-file for new-files fixtures (#687)
1 parent a5d4c3d commit 42a5095

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"common-tags": "^1.8.2",
7575
"esmock": "^2.2.1",
7676
"fs-extra": "^11.1.1",
77+
"move-file": "^3.1.0",
7778
"sinon": "^15.0.3",
7879
"tempy": "^3.0.0",
7980
"write-pkg": "^5.1.0",

test/new-files.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'node:path';
2-
import fs from 'node:fs/promises';
32
import test from 'ava';
43
import esmock from 'esmock';
4+
import {renameFile} from 'move-file';
55
import {runIfExists} from './_utils.js';
66

77
const getFixture = name => path.resolve('test', 'fixtures', 'files', name);
@@ -59,10 +59,10 @@ test('package.json files field and npmignore', mockPkgDir, 'files-and-npmignore'
5959

6060
const renameDotGitignore = {
6161
async before(fixtureDir) {
62-
await fs.rename(`${fixtureDir}/gitignore`, `${fixtureDir}/.gitignore`);
62+
await renameFile('gitignore', '.gitignore', {cwd: fixtureDir});
6363
},
6464
async after(fixtureDir) {
65-
await fs.rename(`${fixtureDir}/.gitignore`, `${fixtureDir}/gitignore`);
65+
await renameFile('.gitignore', 'gitignore', {cwd: fixtureDir});
6666
},
6767
};
6868

0 commit comments

Comments
 (0)