Skip to content

Commit

Permalink
Use renameFile from move-file for new-files fixtures (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mitchell committed Apr 6, 2023
1 parent a5d4c3d commit 42a5095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"common-tags": "^1.8.2",
"esmock": "^2.2.1",
"fs-extra": "^11.1.1",
"move-file": "^3.1.0",
"sinon": "^15.0.3",
"tempy": "^3.0.0",
"write-pkg": "^5.1.0",
Expand Down
6 changes: 3 additions & 3 deletions test/new-files.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import fs from 'node:fs/promises';
import test from 'ava';
import esmock from 'esmock';
import {renameFile} from 'move-file';
import {runIfExists} from './_utils.js';

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

const renameDotGitignore = {
async before(fixtureDir) {
await fs.rename(`${fixtureDir}/gitignore`, `${fixtureDir}/.gitignore`);
await renameFile('gitignore', '.gitignore', {cwd: fixtureDir});
},
async after(fixtureDir) {
await fs.rename(`${fixtureDir}/.gitignore`, `${fixtureDir}/gitignore`);
await renameFile('.gitignore', 'gitignore', {cwd: fixtureDir});
},
};

Expand Down

0 comments on commit 42a5095

Please sign in to comment.