@@ -5,7 +5,7 @@ import importFresh from 'import-fresh';
5
5
import clearModule from 'clear-module' ;
6
6
import del from 'del' ;
7
7
import test from 'ava' ;
8
- import uuid from 'uuid' ;
8
+ import { v4 as uuidv4 } from 'uuid' ;
9
9
import sinon from 'sinon' ;
10
10
import assertDateEqual from './helpers/_assert' ;
11
11
import { buildEACCES , buildEIO , buildENOSPC , buildENOENT , buildEPERM , buildERRSTREAMWRITEAFTEREND } from './helpers/_fs-errors' ;
@@ -18,8 +18,8 @@ test.before(() => {
18
18
} ) ;
19
19
20
20
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 ( ) ;
23
23
t . context . creates = [ t . context . source , t . context . destination ] ;
24
24
} ) ;
25
25
@@ -90,7 +90,7 @@ test('do not create `destination` on unreadable `source`', async t => {
90
90
} ) ;
91
91
92
92
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 ( ) ) ) ) ;
94
94
t . is ( error . name , 'CpFileError' , error . message ) ;
95
95
t . is ( error . code , 'EISDIR' , error . message ) ;
96
96
t . throws ( ( ) => {
@@ -122,8 +122,8 @@ test('throw an Error if `source` does not exists', async t => {
122
122
} ) ;
123
123
124
124
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 ( ) ) ;
127
127
const mkdirError = buildEACCES ( directoryPath ) ;
128
128
129
129
fs . stat = sinon . stub ( fs , 'stat' ) . throws ( mkdirError ) ;
0 commit comments