7
7
* file that was distributed with this source code.
8
8
*/
9
9
10
- import test from 'japa'
10
+ import { test } from '@ japa/runner '
11
11
import execa from 'execa'
12
12
import { join } from 'path'
13
13
import { Filesystem } from '@poppinss/dev-utils'
@@ -20,19 +20,19 @@ const ui = instantiate(true)
20
20
const fs = new Filesystem ( join ( __dirname , '__app' ) )
21
21
22
22
test . group ( 'Compiler' , ( group ) => {
23
- group . before ( ( ) => {
23
+ group . setup ( ( ) => {
24
24
ui . logger . useRenderer ( ui . testingRenderer )
25
25
} )
26
26
27
- group . afterEach ( ( ) => {
27
+ group . each . teardown ( ( ) => {
28
28
ui . testingRenderer . logs = [ ]
29
29
} )
30
30
31
- group . afterEach ( async ( ) => {
31
+ group . each . teardown ( async ( ) => {
32
32
await fs . cleanup ( )
33
33
} )
34
34
35
- test ( 'build source files' , async ( assert ) => {
35
+ test ( 'build source files' , async ( { assert } ) => {
36
36
await fs . add (
37
37
'.adonisrc.json' ,
38
38
JSON . stringify ( {
@@ -96,7 +96,7 @@ test.group('Compiler', (group) => {
96
96
assert . isFalse ( require ( join ( fs . basePath , 'build' , '.adonisrc.json' ) ) . typescript )
97
97
} ) . timeout ( 0 )
98
98
99
- test ( 'build source files with explicit outDir' , async ( assert ) => {
99
+ test ( 'build source files with explicit outDir' , async ( { assert } ) => {
100
100
await fs . add (
101
101
'.adonisrc.json' ,
102
102
JSON . stringify ( {
@@ -158,7 +158,7 @@ test.group('Compiler', (group) => {
158
158
] )
159
159
} ) . timeout ( 0 )
160
160
161
- test ( 'build source files with explicit rootDir' , async ( assert ) => {
161
+ test ( 'build source files with explicit rootDir' , async ( { assert } ) => {
162
162
await fs . add (
163
163
'.adonisrc.json' ,
164
164
JSON . stringify ( {
@@ -221,7 +221,7 @@ test.group('Compiler', (group) => {
221
221
] )
222
222
} ) . timeout ( 0 )
223
223
224
- test ( 'build source files to nested outDir' , async ( assert ) => {
224
+ test ( 'build source files to nested outDir' , async ( { assert } ) => {
225
225
await fs . add (
226
226
'.adonisrc.json' ,
227
227
JSON . stringify ( {
@@ -284,7 +284,7 @@ test.group('Compiler', (group) => {
284
284
] )
285
285
} ) . timeout ( 0 )
286
286
287
- test ( 'do not build when config has errors' , async ( assert ) => {
287
+ test ( 'do not build when config has errors' , async ( { assert } ) => {
288
288
await fs . add (
289
289
'.adonisrc.json' ,
290
290
JSON . stringify ( {
@@ -333,7 +333,7 @@ test.group('Compiler', (group) => {
333
333
] )
334
334
} ) . timeout ( 0 )
335
335
336
- test ( 'catch and report typescript errors' , async ( assert ) => {
336
+ test ( 'catch and report typescript errors' , async ( { assert } ) => {
337
337
await fs . add (
338
338
'.adonisrc.json' ,
339
339
JSON . stringify ( {
@@ -401,7 +401,7 @@ test.group('Compiler', (group) => {
401
401
] )
402
402
} ) . timeout ( 0 )
403
403
404
- test ( 'do not continue on error' , async ( assert ) => {
404
+ test ( 'do not continue on error' , async ( { assert } ) => {
405
405
await fs . add (
406
406
'.adonisrc.json' ,
407
407
JSON . stringify ( {
@@ -469,7 +469,7 @@ test.group('Compiler', (group) => {
469
469
] )
470
470
} ) . timeout ( 0 )
471
471
472
- test ( 'do not emit when noEmitOnError is true' , async ( assert ) => {
472
+ test ( 'do not emit when noEmitOnError is true' , async ( { assert } ) => {
473
473
await fs . add (
474
474
'.adonisrc.json' ,
475
475
JSON . stringify ( {
@@ -530,7 +530,7 @@ test.group('Compiler', (group) => {
530
530
] )
531
531
} ) . timeout ( 0 )
532
532
533
- test ( 'build for production should copy package files to build folder' , async ( assert ) => {
533
+ test ( 'build for production should copy package files to build folder' , async ( { assert } ) => {
534
534
await fs . add (
535
535
'.adonisrc.json' ,
536
536
JSON . stringify ( {
@@ -618,7 +618,9 @@ test.group('Compiler', (group) => {
618
618
assert . isTrue ( hasPackageLock )
619
619
} ) . timeout ( 0 )
620
620
621
- test ( 'gracefully log error when ace file finishes with non-zero exit code' , async ( assert ) => {
621
+ test ( 'gracefully log error when ace file finishes with non-zero exit code' , async ( {
622
+ assert,
623
+ } ) => {
622
624
await fs . add (
623
625
'.adonisrc.json' ,
624
626
JSON . stringify ( {
@@ -689,7 +691,7 @@ test.group('Compiler', (group) => {
689
691
assert . isFalse ( require ( join ( fs . basePath , 'build' , '.adonisrc.json' ) ) . typescript )
690
692
} ) . timeout ( 0 )
691
693
692
- test ( 'ignore error when any of the meta file is missing' , async ( assert ) => {
694
+ test ( 'ignore error when any of the meta file is missing' , async ( { assert } ) => {
693
695
await fs . add (
694
696
'.adonisrc.json' ,
695
697
JSON . stringify ( {
@@ -744,7 +746,7 @@ test.group('Compiler', (group) => {
744
746
assert . isFalse ( require ( join ( fs . basePath , 'build' , '.adonisrc.json' ) ) . typescript )
745
747
} ) . timeout ( 0 )
746
748
747
- test ( 'build should support custom tsconfig file' , async ( assert ) => {
749
+ test ( 'build should support custom tsconfig file' , async ( { assert } ) => {
748
750
await fs . add (
749
751
'.adonisrc.json' ,
750
752
JSON . stringify ( {
@@ -795,7 +797,7 @@ test.group('Compiler', (group) => {
795
797
assert . deepEqual ( hasFiles , [ true , true , false ] )
796
798
} ) . timeout ( 0 )
797
799
798
- test ( 'typecheck and report typescript errors' , async ( assert ) => {
800
+ test ( 'typecheck and report typescript errors' , async ( { assert } ) => {
799
801
await fs . add (
800
802
'.adonisrc.json' ,
801
803
JSON . stringify ( {
@@ -848,7 +850,7 @@ test.group('Compiler', (group) => {
848
850
] )
849
851
} ) . timeout ( 0 )
850
852
851
- test ( 'complete successfully when typechecking has no errors' , async ( assert ) => {
853
+ test ( 'complete successfully when typechecking has no errors' , async ( { assert } ) => {
852
854
await fs . add (
853
855
'.adonisrc.json' ,
854
856
JSON . stringify ( {
0 commit comments