1
+ const playwright = require ( "playwright" ) ;
1
2
const webpack = require ( "webpack" ) ;
2
- const playwright = require ( 'playwright' ) ;
3
3
4
4
process . env . CHROME_BIN = playwright . chromium . executablePath ( ) ;
5
5
process . env . FIREFOX_BIN = playwright . firefox . executablePath ( ) ;
6
6
7
7
module . exports = function ( config ) {
8
- config . set ( {
8
+ const configuration = {
9
9
frameworks : [ "webpack" , "mocha" ] ,
10
10
files : [ "src/**/!(node).spec.ts" ] ,
11
11
preprocessors : {
12
12
"src/**/!(node).spec.ts" : [ "webpack" ]
13
13
} ,
14
14
envPreprocessor : [ "CI" ] ,
15
15
reporters : [ "progress" ] ,
16
- browsers : [ "ChromeHeadless" , "FirefoxHeadless" ] ,
16
+ browsers : process . env . CI
17
+ ? [ "ChromeHeadlessCI" , "FirefoxHeadless" ]
18
+ : [ "ChromeHeadless" , "FirefoxHeadless" ] ,
19
+ customLaunchers : {
20
+ ChromeHeadlessCI : {
21
+ base : "ChromeHeadless" ,
22
+ flags : [
23
+ "--no-sandbox" ,
24
+ "--disable-gpu" ,
25
+ "--disable-dev-shm-usage" ,
26
+ "--disable-software-rasterizer" ,
27
+ "--disable-extensions"
28
+ ]
29
+ }
30
+ } ,
17
31
singleRun : true ,
18
32
client : {
19
33
mocha : {
@@ -28,7 +42,7 @@ module.exports = function (config) {
28
42
plugins : [
29
43
new webpack . DefinePlugin ( {
30
44
"process.env.CI" : process . env . CI || false ,
31
- "process.env.DISPLAY" : "Browser" ,
45
+ "process.env.DISPLAY" : "Browser"
32
46
} ) ,
33
47
new webpack . ProvidePlugin ( {
34
48
process : "process/browser.js"
@@ -45,5 +59,7 @@ module.exports = function (config) {
45
59
stats : { warnings : false } ,
46
60
devtool : "inline-source-map"
47
61
}
48
- } ) ;
62
+ } ;
63
+
64
+ config . set ( configuration ) ;
49
65
} ;
0 commit comments