@@ -36,6 +36,12 @@ const opts = yargs(hideBin(process.argv))
36
36
group : 'Options:' ,
37
37
describe : 'Bundle the resolved spec using the given command'
38
38
} )
39
+ . option ( 'bundle-stdin' , {
40
+ type : 'string' ,
41
+ group : 'Options:' ,
42
+ describe :
43
+ 'Pass a synthetic file as stdin to the bundler with "require" or "import" statements for each spec file'
44
+ } )
39
45
. option ( 'esm' , {
40
46
type : 'boolean' ,
41
47
group : 'Options:' ,
@@ -57,23 +63,27 @@ const opts = yargs(hideBin(process.argv))
57
63
'Options:' : 'Other:'
58
64
} )
59
65
. example (
60
- '$0 --driver puppeteer --bundle browserify "./src/**/*.test.js" ' ,
66
+ '$0 --driver puppeteer --bundle browserify "./src/**/*.test.js"' ,
61
67
'Bundle all files matching the given spec using browserify and run them using @mochify/driver-puppeteer.'
62
68
)
63
69
. example (
64
- '$0 --esm --reporter dot --driver puppeteer "./src/**/*.test.js" ' ,
70
+ '$0 --driver playwright --bundle esbuild --bundle-stdin "require" "./src/**/*.test.js"' ,
71
+ 'Bundle all files matching the given spec using esbuild and run them using @mochify/driver-playwright.'
72
+ )
73
+ . example (
74
+ '$0 --esm --reporter dot --driver puppeteer "./src/**/*.test.js"' ,
65
75
'Run all tests matching the given spec as ES modules in puppeteer and use the "dot" reporter for output.'
66
76
)
67
77
. example (
68
- '$0 "./src/**/*.test.js" ' ,
78
+ '$0 "./src/**/*.test.js"' ,
69
79
'Run all tests matching the given spec using the default configuration lookup.'
70
80
)
71
81
. example (
72
- '$0 --config mochify.webdriver.js "./src/**/*.test.js" ' ,
82
+ '$0 --config mochify.webdriver.js "./src/**/*.test.js"' ,
73
83
'Run all tests matching the given spec using the configuration from mochify.webdriver.js.'
74
84
)
75
85
. example (
76
- 'browserify "./src/**/*.test.js" | $0 -' ,
86
+ 'browserify "./src/**/*.test.js" | $0 -' ,
77
87
'Read a bundled test suite from stdin.'
78
88
)
79
89
. epilogue (
@@ -89,6 +99,9 @@ if (opts['driver-option']) {
89
99
if ( opts [ 'server-option' ] ) {
90
100
opts . server_options = opts [ 'server-option' ] ;
91
101
}
102
+ if ( opts [ 'bundle-stdin' ] ) {
103
+ opts . bundle_stdin = opts [ 'bundle-stdin' ] ;
104
+ }
92
105
93
106
if ( opts . _ . length ) {
94
107
if ( opts . _ [ 0 ] === '-' ) {
0 commit comments