Skip to content

Commit 5f5151d

Browse files
committedMar 5, 2020
Meta tweaks
1 parent 4e536d5 commit 5f5151d

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed
 

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"nyc": "^15.0.0",
5454
"sinon": "^9.0.0",
5555
"tsd": "^0.11.0",
56-
"uuid": "^3.3.2",
57-
"xo": "^0.26.1"
56+
"uuid": "^7.0.2",
57+
"xo": "^0.27.2"
5858
}
5959
}

‎test/async.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import importFresh from 'import-fresh';
55
import clearModule from 'clear-module';
66
import del from 'del';
77
import test from 'ava';
8-
import uuid from 'uuid';
8+
import {v4 as uuidv4} from 'uuid';
99
import sinon from 'sinon';
1010
import assertDateEqual from './helpers/_assert';
1111
import {buildEACCES, buildEIO, buildENOSPC, buildENOENT, buildEPERM, buildERRSTREAMWRITEAFTEREND} from './helpers/_fs-errors';
@@ -18,8 +18,8 @@ test.before(() => {
1818
});
1919

2020
test.beforeEach(t => {
21-
t.context.source = uuid.v4();
22-
t.context.destination = uuid.v4();
21+
t.context.source = uuidv4();
22+
t.context.destination = uuidv4();
2323
t.context.creates = [t.context.source, t.context.destination];
2424
});
2525

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

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

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

129129
fs.stat = sinon.stub(fs, 'stat').throws(mkdirError);

‎test/progress.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path';
33
import fs from 'graceful-fs';
44
import del from 'del';
55
import test from 'ava';
6-
import uuid from 'uuid';
6+
import {v4 as uuidv4} from 'uuid';
77
import cpFile from '..';
88

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

1515
test.beforeEach(t => {
16-
t.context.source = uuid.v4();
17-
t.context.destination = uuid.v4();
16+
t.context.source = uuidv4();
17+
t.context.destination = uuidv4();
1818
t.context.creates = [t.context.source, t.context.destination];
1919
});
2020

‎test/sync.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path';
33
import fs from 'graceful-fs';
44
import del from 'del';
55
import test from 'ava';
6-
import uuid from 'uuid';
6+
import {v4 as uuidv4} from 'uuid';
77
import sinon from 'sinon';
88
import assertDateEqual from './helpers/_assert';
99
import {buildEACCES, buildENOSPC, buildEBADF} from './helpers/_fs-errors';
@@ -16,8 +16,8 @@ test.before(() => {
1616
});
1717

1818
test.beforeEach(t => {
19-
t.context.source = uuid.v4();
20-
t.context.destination = uuid.v4();
19+
t.context.source = uuidv4();
20+
t.context.destination = uuidv4();
2121
t.context.creates = [t.context.source, t.context.destination];
2222
});
2323

@@ -100,7 +100,7 @@ test('do not create `destination` on unreadable `source`', t => {
100100
test('do not create `destination` directory on unreadable `source`', t => {
101101
t.throws(
102102
() => {
103-
cpFile.sync('node_modules', 'subdir/' + uuid.v4());
103+
cpFile.sync('node_modules', `subdir/${uuidv4()}`);
104104
},
105105
{
106106
name: 'CpFileError',
@@ -139,8 +139,8 @@ test('throw an Error if `source` does not exists', t => {
139139
});
140140

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.