@@ -67,7 +67,7 @@ import { vueOutputTarget } from '@stencil/vue-output-target';
67
67
* @param prod - production specific options to set
68
68
*/
69
69
export function getStencilConfig ( { namespace, args, jestConfig, distCustomElements, distCustomElementsBundle, reactOutput, vueOutput, dev, prod } ) {
70
- const isCi = args . some ( ( arg ) => arg . match ( / ( - - | : ) c i / g) ) ,
70
+ const isCi = args . some ( ( arg ) => arg . match ( / ( - - | : ) c i / g) ) ,
71
71
/**
72
72
* stencil doc:
73
73
* ```
@@ -76,7 +76,7 @@ export function getStencilConfig({ namespace, args, jestConfig, distCustomElemen
76
76
* ```
77
77
* @see https://stenciljs.com/docs/cli
78
78
*/
79
- isDev = args . includes ( '--dev' ) ,
79
+ isDev = args . includes ( '--dev' ) ,
80
80
/**
81
81
* stencil doc:
82
82
* ```
@@ -92,28 +92,11 @@ export function getStencilConfig({ namespace, args, jestConfig, distCustomElemen
92
92
jestConfig = args . includes ( 'test' ) ? jestConfig : undefined ;
93
93
let convertedJestConfig = { } ;
94
94
if ( jestConfig ) {
95
- convertedJestConfig = Object . assign ( Object . assign ( { } , jestConfig ) , {
96
- // preset: "../../../../node_modules/jest-puppeteer",
97
- // transform: { "^.+\\.(js|ts|tsx)$": "<rootDir>/../../../../node_modules/@stencil/core/testing/jest-preprocessor.js" },
98
- // testEnvironment: "<rootDir>/../../../../node_modules/@stencil/core/testing/jest-environment.js"
99
- // incompatible props
100
- bail : undefined , restoreMocks : undefined , transform : jestConfig . transform ,
101
- // adaptations
102
- testRegex : jestConfig . testRegex , globalSetup : jestConfig . globalSetup === null ? undefined : jestConfig . globalSetup , globalTeardown : jestConfig . globalTeardown === null ? undefined : jestConfig . globalTeardown , prettierPath : jestConfig . prettierPath === null ? undefined : jestConfig . prettierPath , resolver : jestConfig . resolver === null ? undefined : jestConfig . resolver ,
103
- // force erase preset
104
- preset : undefined
105
- } ) ;
106
- // warning incompatible props
107
- Object . keys ( jestConfig )
108
- . filter ( k => [ 'bail' , 'restoreMocks' , 'transform' ] . some ( p => p === k ) )
109
- . forEach ( ( k ) => {
110
- if ( ! ( jestConfig === null || jestConfig === void 0 ? void 0 : jestConfig [ k ] ) ) {
111
- throw new Error ( `[getStencilConfig] incompatible property from jest config not integrated into jest stencil. property=${ k } ` ) ;
112
- }
113
- } ) ;
114
- if ( jestConfig . preset ) {
115
- console . warn ( `[ WARN ] [getStencilConfig] ignoring property from jest config not integrated into jest stencil. property=preset` ) ;
116
- }
95
+ convertedJestConfig = {
96
+ verbose : jestConfig . verbose ,
97
+ testRegex : jestConfig . testRegex ,
98
+ moduleNameMapper : jestConfig . moduleNameMapper ,
99
+ } ;
117
100
}
118
101
// manage copy task with custom-element package.json if needed (prod)
119
102
let distCustomElementsCopy = [ ] ;
@@ -200,9 +183,7 @@ export function getStencilConfig({ namespace, args, jestConfig, distCustomElemen
200
183
} ;
201
184
return [ output ] ;
202
185
} ) ( ) : [ ] ) ,
203
- ] } ) , globalScriptOption ) , { devServer : {
204
- startupTimeout : 30000
205
- } , testing : Object . assign ( Object . assign ( Object . assign ( { } , ( jestConfig ? convertedJestConfig : { } ) ) , { browserHeadless : false , browserSlowMo : 2000 } ) , ( isCi ? {
186
+ ] } ) , globalScriptOption ) , { testing : Object . assign ( Object . assign ( Object . assign ( { } , ( jestConfig ? convertedJestConfig : { } ) ) , { browserHeadless : false , browserSlowMo : 2000 } ) , ( isCi ? {
206
187
browserHeadless : true ,
207
188
browserSlowMo : 0 ,
208
189
/**
0 commit comments