File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 "yargs" : " ^18.0.0"
3131 },
3232 "devDependencies" : {
33- "ava" : " ^3.1 .0" ,
33+ "ava" : " ^8.0 .0" ,
3434 "c8" : " ^12.0.0" ,
3535 "eslint" : " ^10.0.0" ,
3636 "eslint-config-problems" : " 10.0.1" ,
Original file line number Diff line number Diff line change @@ -7,22 +7,24 @@ import { exec } from 'node:child_process'
77import tmp from './helpers/tmp.js'
88import read from './helpers/read.js'
99
10- test . cb ( 'reads from stdin' , ( t ) => {
10+ test ( 'reads from stdin' , ( t ) => {
1111 const output = tmp ( 'output.css' )
1212
13- const cp = exec (
14- `node ${ path . resolve ( 'index.js' ) } -o ${ output } --no-map` ,
15- ( error , stdout , stderr ) => {
16- if ( error ) t . end ( error , stderr )
13+ return new Promise ( ( resolve , reject ) => {
14+ const cp = exec (
15+ `node ${ path . resolve ( 'index.js' ) } -o ${ output } --no-map` ,
16+ ( error ) => {
17+ if ( error ) return reject ( error )
1718
18- Promise . all ( [ read ( output ) , read ( 'test/fixtures/a.css' ) ] )
19- . then ( ( [ a , e ] ) => {
20- t . is ( a , e )
21- t . end ( )
22- } )
23- . catch ( t . end )
24- } ,
25- )
19+ Promise . all ( [ read ( output ) , read ( 'test/fixtures/a.css' ) ] )
20+ . then ( ( [ a , e ] ) => {
21+ t . is ( a , e )
22+ resolve ( )
23+ } )
24+ . catch ( reject )
25+ } ,
26+ )
2627
27- createReadStream ( 'test/fixtures/a.css' ) . pipe ( cp . stdin )
28+ createReadStream ( 'test/fixtures/a.css' ) . pipe ( cp . stdin )
29+ } )
2830} )
Original file line number Diff line number Diff line change @@ -6,22 +6,27 @@ import { exec } from 'node:child_process'
66
77import read from './helpers/read.js'
88
9- test . cb ( 'writes to stdout' , ( t ) => {
10- const cp = exec (
11- `node ${ path . resolve (
12- 'index.js' ,
13- ) } --parser sugarss -u postcss-import --no-map`,
14- ( error , stdout , stderr ) => {
15- if ( error ) t . end ( error , stderr )
9+ test ( 'writes to stdout' , ( t ) => {
10+ return new Promise ( ( resolve , reject ) => {
11+ const cp = exec (
12+ `node ${ path . resolve (
13+ 'index.js' ,
14+ ) } --parser sugarss -u postcss-import --no-map`,
15+ ( error , stdout ) => {
16+ if ( error ) return reject ( error )
1617
17- Promise . all ( [ stdout . replace ( / \r \n / g, '\n' ) , read ( 'test/fixtures/s.css' ) ] )
18- . then ( ( [ a , e ] ) => {
19- t . is ( a , e )
20- t . end ( )
21- } )
22- . catch ( t . end )
23- } ,
24- )
18+ Promise . all ( [
19+ stdout . replace ( / \r \n / g, '\n' ) ,
20+ read ( 'test/fixtures/s.css' ) ,
21+ ] )
22+ . then ( ( [ a , e ] ) => {
23+ t . is ( a , e )
24+ resolve ( )
25+ } )
26+ . catch ( reject )
27+ } ,
28+ )
2529
26- createReadStream ( './test/fixtures/a.sss' ) . pipe ( cp . stdin )
30+ createReadStream ( './test/fixtures/a.sss' ) . pipe ( cp . stdin )
31+ } )
2732} )
You can’t perform that action at this time.
0 commit comments