File tree 2 files changed +15
-12
lines changed
2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ const { argv } = require('yargs');
21
21
module . exports = function ( config ) {
22
22
const karmaConfig = {
23
23
...karmaBase ,
24
- browsers : getTestBrowsers ( argv ) ,
25
24
// files to load into karma
26
25
files : getTestFiles ( argv ) ,
27
26
@@ -76,12 +75,4 @@ function getTestFiles(argv) {
76
75
}
77
76
}
78
77
79
- function getTestBrowsers ( argv ) {
80
- let browsers = [ 'ChromeHeadless' ] ;
81
- if ( process . env ?. BROWSERS && argv . unit ) {
82
- browsers = process . env ?. BROWSERS ?. split ( ',' ) ;
83
- }
84
- return browsers ;
85
- }
86
-
87
78
module . exports . files = getTestFiles ( argv ) ;
Original file line number Diff line number Diff line change @@ -239,9 +239,21 @@ function genericBundleReadingTests(bytesPerRead: number): void {
239
239
'Reached the end of bundle when a length string is expected.'
240
240
) ;
241
241
242
- await expect (
243
- generateBundleAndParse ( '{metadata: "no length prefix"}' , bytesPerRead )
244
- ) . to . be . rejectedWith ( / ( U n e x p e c t e d e n d o f ) (? = .* J S O N \b ) .* / gi) ;
242
+ // The multiple "rejectedWith" checks below are an attempt to make the
243
+ // test robust in the presence of various permutations of the error
244
+ // message, which is produced by the JavaScript runtime.
245
+ // Chrome produces: Unexpected end of JSON input
246
+ // Webkit produces: JSON Parse error: Unexpected EOF
247
+ const noLengthPrefixPromise = generateBundleAndParse (
248
+ '{metadata: "no length prefix"}' ,
249
+ bytesPerRead
250
+ ) ;
251
+ await expect ( noLengthPrefixPromise ) . to . be . rejectedWith (
252
+ / ( \b | ^ ) u n e x p e c t e d ( ( e n d o f ) | ( e o f ) ) ( \b | $ ) / gi
253
+ ) ;
254
+ await expect ( noLengthPrefixPromise ) . to . be . rejectedWith (
255
+ / ( \b | ^ ) J S O N ( \b | $ ) / g
256
+ ) ;
245
257
246
258
await expect (
247
259
generateBundleAndParse (
You can’t perform that action at this time.
0 commit comments