File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 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');
2121module . exports = function ( config ) {
2222 const karmaConfig = {
2323 ...karmaBase ,
24- browsers : getTestBrowsers ( argv ) ,
2524 // files to load into karma
2625 files : getTestFiles ( argv ) ,
2726
@@ -76,12 +75,4 @@ function getTestFiles(argv) {
7675 }
7776}
7877
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-
8778module . exports . files = getTestFiles ( argv ) ;
Original file line number Diff line number Diff line change @@ -239,9 +239,21 @@ function genericBundleReadingTests(bytesPerRead: number): void {
239239 'Reached the end of bundle when a length string is expected.'
240240 ) ;
241241
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+ ) ;
245257
246258 await expect (
247259 generateBundleAndParse (
You can’t perform that action at this time.
0 commit comments