Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 5, 2020
1 parent 4e536d5 commit 5f5151d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -53,7 +53,7 @@
"nyc": "^15.0.0",
"sinon": "^9.0.0",
"tsd": "^0.11.0",
"uuid": "^3.3.2",
"xo": "^0.26.1"
"uuid": "^7.0.2",
"xo": "^0.27.2"
}
}
12 changes: 6 additions & 6 deletions test/async.js
Expand Up @@ -5,7 +5,7 @@ import importFresh from 'import-fresh';
import clearModule from 'clear-module';
import del from 'del';
import test from 'ava';
import uuid from 'uuid';
import {v4 as uuidv4} from 'uuid';
import sinon from 'sinon';
import assertDateEqual from './helpers/_assert';
import {buildEACCES, buildEIO, buildENOSPC, buildENOENT, buildEPERM, buildERRSTREAMWRITEAFTEREND} from './helpers/_fs-errors';
Expand All @@ -18,8 +18,8 @@ test.before(() => {
});

test.beforeEach(t => {
t.context.source = uuid.v4();
t.context.destination = uuid.v4();
t.context.source = uuidv4();
t.context.destination = uuidv4();
t.context.creates = [t.context.source, t.context.destination];
});

Expand Down Expand Up @@ -90,7 +90,7 @@ test('do not create `destination` on unreadable `source`', async t => {
});

test('do not create `destination` directory on unreadable `source`', async t => {
const error = await t.throwsAsync(cpFile('node_modules', path.join('subdir', uuid.v4())));
const error = await t.throwsAsync(cpFile('node_modules', path.join('subdir', uuidv4())));
t.is(error.name, 'CpFileError', error.message);
t.is(error.code, 'EISDIR', error.message);
t.throws(() => {
Expand Down Expand Up @@ -122,8 +122,8 @@ test('throw an Error if `source` does not exists', async t => {
});

test.serial('rethrow mkdir EACCES errors', async t => {
const directoryPath = `/root/NO_ACCESS_${uuid.v4()}`;
const destination = path.join(directoryPath, uuid.v4());
const directoryPath = `/root/NO_ACCESS_${uuidv4()}`;
const destination = path.join(directoryPath, uuidv4());
const mkdirError = buildEACCES(directoryPath);

fs.stat = sinon.stub(fs, 'stat').throws(mkdirError);
Expand Down
6 changes: 3 additions & 3 deletions test/progress.js
Expand Up @@ -3,7 +3,7 @@ import path from 'path';
import fs from 'graceful-fs';
import del from 'del';
import test from 'ava';
import uuid from 'uuid';
import {v4 as uuidv4} from 'uuid';
import cpFile from '..';

const THREE_HUNDRED_KILO = (100 * 3 * 1024) + 1;
Expand All @@ -13,8 +13,8 @@ test.before(() => {
});

test.beforeEach(t => {
t.context.source = uuid.v4();
t.context.destination = uuid.v4();
t.context.source = uuidv4();
t.context.destination = uuidv4();
t.context.creates = [t.context.source, t.context.destination];
});

Expand Down
12 changes: 6 additions & 6 deletions test/sync.js
Expand Up @@ -3,7 +3,7 @@ import path from 'path';
import fs from 'graceful-fs';
import del from 'del';
import test from 'ava';
import uuid from 'uuid';
import {v4 as uuidv4} from 'uuid';
import sinon from 'sinon';
import assertDateEqual from './helpers/_assert';
import {buildEACCES, buildENOSPC, buildEBADF} from './helpers/_fs-errors';
Expand All @@ -16,8 +16,8 @@ test.before(() => {
});

test.beforeEach(t => {
t.context.source = uuid.v4();
t.context.destination = uuid.v4();
t.context.source = uuidv4();
t.context.destination = uuidv4();
t.context.creates = [t.context.source, t.context.destination];
});

Expand Down Expand Up @@ -100,7 +100,7 @@ test('do not create `destination` on unreadable `source`', t => {
test('do not create `destination` directory on unreadable `source`', t => {
t.throws(
() => {
cpFile.sync('node_modules', 'subdir/' + uuid.v4());
cpFile.sync('node_modules', `subdir/${uuidv4()}`);
},
{
name: 'CpFileError',
Expand Down Expand Up @@ -139,8 +139,8 @@ test('throw an Error if `source` does not exists', t => {
});

test('rethrow mkdir EACCES errors', t => {
const directoryPath = `/root/NO_ACCESS_${uuid.v4()}`;
const destination = path.join(directoryPath, uuid.v4());
const directoryPath = `/root/NO_ACCESS_${uuidv4()}`;
const destination = path.join(directoryPath, uuidv4());
const mkdirError = buildEACCES(directoryPath);

fs.mkdirSync = sinon.stub(fs, 'mkdirSync').throws(mkdirError);
Expand Down

0 comments on commit 5f5151d

Please sign in to comment.