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" ;
5
5
6
- import { x } from ' tinyexec' ;
7
- import { fix } from ' @commitlint/test' ;
6
+ import { x } from " tinyexec" ;
7
+ import { fix } from " @commitlint/test" ;
8
8
9
9
const require = createRequire ( import . meta. url ) ;
10
10
11
- const __dirname = path . resolve ( fileURLToPath ( import . meta. url ) , '..' ) ;
11
+ const __dirname = path . resolve ( fileURLToPath ( import . meta. url ) , ".." ) ;
12
12
13
- const bin = require . resolve ( ' ./cli.js' ) ;
13
+ const bin = require . resolve ( " ./cli.js" ) ;
14
14
15
15
function cli ( args , options , input ) {
16
16
const result = x ( bin , args , {
@@ -28,15 +28,15 @@ function cli(args, options, input) {
28
28
29
29
const fixBootstrap = ( fixture ) => fix . bootstrap ( fixture , __dirname ) ;
30
30
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" ) ;
35
35
} ) ;
36
36
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 ( "" ) ;
42
42
} ) ;
0 commit comments