7
7
* file that was distributed with this source code.
8
8
*/
9
9
10
- import { BaseCommand , flags } from '@adonisjs/core/build/standalone'
10
+ import { BaseCommand , flags , args } from '@adonisjs/core/build/standalone'
11
11
import { JapaFlags } from '../src/Contracts'
12
12
13
13
/**
@@ -20,6 +20,9 @@ export default class Test extends BaseCommand {
20
20
stayAlive : true ,
21
21
}
22
22
23
+ @args . spread ( { description : 'Run tests for only the specified suites' , required : false } )
24
+ public suites : string [ ]
25
+
23
26
/**
24
27
* Allows watching for file changes
25
28
*/
@@ -44,24 +47,27 @@ export default class Test extends BaseCommand {
44
47
@flags . array ( { description : 'CLI options to pass to the node command line' } )
45
48
public nodeArgs : string [ ] = [ ]
46
49
47
- @flags . array ( { description : 'Run tests for only specified tags' } )
50
+ /**
51
+ * Filter by tags
52
+ */
53
+ @flags . array ( { description : 'Filter tests by tags' } )
48
54
public tags : string [ ]
49
55
50
- @flags . array ( { description : 'Run all the tests except the tests using specified tags' } )
56
+ /**
57
+ * Filter by tags
58
+ */
59
+ @flags . array ( { description : 'Filter tests by ignoring tags' } )
51
60
public ignoreTags : string [ ]
52
61
53
- @flags . number ( { description : 'Define timeout for tests' } )
62
+ /**
63
+ * Customize tests timeout
64
+ */
65
+ @flags . number ( { description : 'Customize tests timeout' } )
54
66
public timeout : number
55
67
56
- @flags . array ( { description : 'Run tests for only the specified suites' } )
57
- public suites : string [ ]
58
-
59
- @flags . array ( { description : 'Run tests for only the specified groups' } )
60
- public groups : string [ ]
61
-
62
- @flags . array ( { description : 'Run tests with the specified titles' } )
63
- public tests : string [ ]
64
-
68
+ /**
69
+ * Force exit the tests runner
70
+ */
65
71
@flags . boolean ( { description : 'Force exit the tests runner process' } )
66
72
public forceExit : boolean
67
73
@@ -78,20 +84,12 @@ export default class Test extends BaseCommand {
78
84
filters [ '--timeout' ] = this . timeout
79
85
}
80
86
81
- if ( this . tests ) {
82
- filters [ '--tests' ] = this . tests
83
- }
84
-
85
- if ( this . groups ) {
86
- filters [ '--groups' ] = this . groups
87
+ if ( this . tags ) {
88
+ filters [ '--tags' ] = this . tags
87
89
}
88
90
89
91
if ( this . suites ) {
90
- filters [ '--suites' ] = this . suites
91
- }
92
-
93
- if ( this . tags ) {
94
- filters [ '--tags' ] = this . tags
92
+ filters . _ = this . suites
95
93
}
96
94
97
95
if ( this . ignoreTags ) {
0 commit comments