1- import path from 'path' ;
2- import fs from 'fs' ;
1+ import path from 'node: path' ;
2+ import fs from 'node: fs' ;
33import test from 'ava' ;
44import 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' ;
77
88const read = ( ...args ) => fs . readFileSync ( path . join ( ...args ) , 'utf8' ) ;
99
@@ -12,11 +12,11 @@ test.beforeEach(t => {
1212} ) ;
1313
1414test ( '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 / } ) ;
1616} ) ;
1717
1818test ( '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 / } ) ;
2020} ) ;
2121
2222test ( 'cwd' , async t => {
@@ -71,6 +71,6 @@ test('do not copy files in the negated glob patterns', async t => {
7171 await execa ( './cli.js' , [ 'src/*.*' , '!src/*.jsx' , '!src/*.es2015' , 'dest' , '--cwd' , t . context . tmp ] ) ;
7272
7373 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' ) ) ) ;
7676} ) ;
0 commit comments