1
- import path from 'path' ;
2
- import fs from 'fs' ;
1
+ import path from 'node: path' ;
2
+ import fs from 'node: fs' ;
3
3
import test from 'ava' ;
4
4
import tempfile from 'tempfile' ;
5
- import execa from 'execa' ;
6
- import pathExists from 'path-exists' ;
5
+ import { execa } from 'execa' ;
6
+ import { pathExistsSync } from 'path-exists' ;
7
7
8
8
const read = ( ...args ) => fs . readFileSync ( path . join ( ...args ) , 'utf8' ) ;
9
9
@@ -12,11 +12,11 @@ test.beforeEach(t => {
12
12
} ) ;
13
13
14
14
test ( 'missing file operands' , async t => {
15
- await t . throwsAsync ( execa ( './cli.js' ) , / ` s o u r c e ` a n d ` d e s t i n a t i o n ` r e q u i r e d / ) ;
15
+ await t . throwsAsync ( execa ( './cli.js' ) , { message : / ` s o u r c e ` a n d ` d e s t i n a t i o n ` r e q u i r e d / } ) ;
16
16
} ) ;
17
17
18
18
test ( 'source file does not exist' , async t => {
19
- await t . throwsAsync ( execa ( './cli.js' , [ path . join ( t . context . tmp , 'nonexistentfile' ) , t . context . tmp ] ) , / n o n e x i s t e n t f i l e / ) ;
19
+ await t . throwsAsync ( execa ( './cli.js' , [ path . join ( t . context . tmp , 'nonexistentfile' ) , t . context . tmp ] ) , { message : / n o n e x i s t e n t f i l e / } ) ;
20
20
} ) ;
21
21
22
22
test ( 'cwd' , async t => {
@@ -71,6 +71,6 @@ test('do not copy files in the negated glob patterns', async t => {
71
71
await execa ( './cli.js' , [ 'src/*.*' , '!src/*.jsx' , '!src/*.es2015' , 'dest' , '--cwd' , t . context . tmp ] ) ;
72
72
73
73
t . is ( read ( t . context . tmp , 'dest/hello.js' ) , 'console.log("hello");' ) ;
74
- t . false ( pathExists . sync ( path . join ( t . context . tmp , 'dest/hello.jsx' ) ) ) ;
75
- t . false ( pathExists . sync ( path . join ( t . context . tmp , 'dest/hello.es2015' ) ) ) ;
74
+ t . false ( pathExistsSync ( path . join ( t . context . tmp , 'dest/hello.jsx' ) ) ) ;
75
+ t . false ( pathExistsSync ( path . join ( t . context . tmp , 'dest/hello.es2015' ) ) ) ;
76
76
} ) ;
0 commit comments