1- import { test , expect } from ' vitest' ;
2- import { createRequire } from ' node:module' ;
3- import path from ' node:path' ;
4- import { fileURLToPath } from ' node:url' ;
1+ import { test , expect } from " vitest" ;
2+ import { createRequire } from " node:module" ;
3+ import path from " node:path" ;
4+ import { fileURLToPath } from " node:url" ;
55
6- import { x } from ' tinyexec' ;
7- import { fix } from ' @commitlint/test' ;
6+ import { x } from " tinyexec" ;
7+ import { fix } from " @commitlint/test" ;
88
99const require = createRequire ( import . meta. url ) ;
1010
11- const __dirname = path . resolve ( fileURLToPath ( import . meta. url ) , '..' ) ;
11+ const __dirname = path . resolve ( fileURLToPath ( import . meta. url ) , ".." ) ;
1212
13- const bin = require . resolve ( ' ./cli.js' ) ;
13+ const bin = require . resolve ( " ./cli.js" ) ;
1414
1515function cli ( args , options , input ) {
1616 const result = x ( bin , args , {
@@ -28,15 +28,15 @@ function cli(args, options, input) {
2828
2929const fixBootstrap = ( fixture ) => fix . bootstrap ( fixture , __dirname ) ;
3030
31- test ( ' should reprint input from stdin' , async ( ) => {
32- const cwd = await fixBootstrap ( ' fixtures/default' ) ;
33- const actual = await cli ( [ ] , { cwd} , ' foo: bar' ) ;
34- expect ( actual . stdout ) . toContain ( ' foo: bar' ) ;
31+ test ( " should reprint input from stdin" , async ( ) => {
32+ const cwd = await fixBootstrap ( " fixtures/default" ) ;
33+ const actual = await cli ( [ ] , { cwd } , " foo: bar" ) ;
34+ expect ( actual . stdout ) . toContain ( " foo: bar" ) ;
3535} ) ;
3636
37- test ( ' should produce success output with --verbose flag' , async ( ) => {
38- const cwd = await fixBootstrap ( ' fixtures/default' ) ;
39- const actual = await cli ( [ ' --verbose' ] , { cwd} , ' type: bar' ) ;
40- expect ( actual . stdout ) . toContain ( ' 0 problems, 0 warnings' ) ;
41- expect ( actual . stderr ) . toEqual ( '' ) ;
37+ test ( " should produce success output with --verbose flag" , async ( ) => {
38+ const cwd = await fixBootstrap ( " fixtures/default" ) ;
39+ const actual = await cli ( [ " --verbose" ] , { cwd } , " type: bar" ) ;
40+ expect ( actual . stdout ) . toContain ( " 0 problems, 0 warnings" ) ;
41+ expect ( actual . stderr ) . toEqual ( "" ) ;
4242} ) ;
0 commit comments