@@ -18,21 +18,27 @@ test('should run command successfully', async () => {
1818
1919// write file on the temp directory
2020test ( 'should write file on the temp directory' , async ( ) => {
21- const tempDir = await fs . realpath ( await fs . mkdtemp ( path . join ( tmpdir ( ) , 'vite-plus-test-' ) ) ) ;
21+ const tempDir = await fs . realpath (
22+ await fs . mkdtemp ( path . join ( tmpdir ( ) , 'vite-plus-test-' ) ) ,
23+ ) ;
2224 const result = await runCommand ( {
2325 binName : 'node' ,
2426 args : [ '-e' , `fs.writeFileSync("test.txt", "Hello, world!")` ] ,
2527 envs : { } ,
2628 cwd : tempDir ,
2729 } ) ;
2830 expect ( result ) . toMatchSnapshot ( ) ;
29- expect ( await fs . readFile ( path . join ( tempDir , 'test.txt' ) , 'utf-8' ) ) . toBe ( 'Hello, world!' ) ;
31+ expect ( await fs . readFile ( path . join ( tempDir , 'test.txt' ) , 'utf-8' ) ) . toBe (
32+ 'Hello, world!' ,
33+ ) ;
3034 await fs . rm ( tempDir , { recursive : true } ) ;
3135} ) ;
3236
3337// read file on the temp directory
3438test ( 'should read file on the temp directory' , async ( ) => {
35- const tempDir = await fs . realpath ( await fs . mkdtemp ( path . join ( tmpdir ( ) , 'vite-plus-test-' ) ) ) ;
39+ const tempDir = await fs . realpath (
40+ await fs . mkdtemp ( path . join ( tmpdir ( ) , 'vite-plus-test-' ) ) ,
41+ ) ;
3642 await fs . writeFile ( path . join ( tempDir , 'test.txt' ) , 'Hello, world!' ) ;
3743 const result = await runCommand ( {
3844 binName : 'node' ,
@@ -46,10 +52,15 @@ test('should read file on the temp directory', async () => {
4652
4753// write and read file on the temp directory
4854test ( 'should write and read file on the temp directory' , async ( ) => {
49- const tempDir = await fs . realpath ( await fs . mkdtemp ( path . join ( tmpdir ( ) , 'vite-plus-test-' ) ) ) ;
55+ const tempDir = await fs . realpath (
56+ await fs . mkdtemp ( path . join ( tmpdir ( ) , 'vite-plus-test-' ) ) ,
57+ ) ;
5058 const result = await runCommand ( {
5159 binName : 'node' ,
52- args : [ '-e' , `fs.writeFileSync("test.txt", "Hello, world!"); fs.readFileSync("test.txt", "utf-8")` ] ,
60+ args : [
61+ '-e' ,
62+ `fs.writeFileSync("test.txt", "Hello, world!"); fs.readFileSync("test.txt", "utf-8")` ,
63+ ] ,
5364 envs : { } ,
5465 cwd : tempDir ,
5566 } ) ;
0 commit comments