Skip to content

Commit c80479d

Browse files
fix(concatjs): update karma to 6.3.2 and fix #2093 (#2603)
1 parent 3564940 commit c80479d

File tree

5 files changed

+284
-385
lines changed

5 files changed

+284
-385
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
"jest": "~25.3.0",
5555
"jest-cli": "~25.3.0",
5656
"jest-websocket-mock": "~2.0.2",
57-
"karma": "~4.1.0",
58-
"karma-chrome-launcher": "2.2.0",
59-
"karma-firefox-launcher": "1.1.0",
60-
"karma-jasmine": "2.0.1",
57+
"karma": "~6.3.2",
58+
"karma-chrome-launcher": "3.1.0",
59+
"karma-firefox-launcher": "2.1.0",
60+
"karma-jasmine": "4.0.1",
6161
"karma-requirejs": "1.1.0",
62-
"karma-sourcemap-loader": "0.3.7",
62+
"karma-sourcemap-loader": "0.3.8",
6363
"lit-element": "^2.2.1",
6464
"minimist": "^1.2.3",
6565
"mock-socket": "~9.0.3",

packages/concatjs/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ ts_project(
3030
"types": ["node"],
3131
},
3232
},
33-
deps = ["@npm//@types/node"],
33+
deps = [
34+
"@npm//@types/node",
35+
"@npm//karma",
36+
],
3437
)
3538

3639
js_library(

packages/concatjs/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
import * as crypto from 'crypto';
66
import * as fs from 'fs';
7+
import * as File from 'karma/lib/file';
78
import * as path from 'path';
89
import * as process from 'process';
910
import {createInterface} from 'readline';
@@ -29,13 +30,8 @@ function initConcatJs(logger, emitter, basePath, hostname, port) {
2930
path.join(process.env['TEST_TMPDIR'], crypto.randomBytes(6).readUIntLE(0, 6).toString(36));
3031

3132
emitter.on('file_list_modified', files => {
32-
const bundleFile = {
33-
path: '/concatjs_bundle.js',
34-
contentPath: tmpFile,
35-
isUrl: false,
36-
content: '',
37-
encodings: {},
38-
} as any;
33+
const bundleFile = new File('/concatjs_bundle.js') as any;
34+
bundleFile.contentPath = tmpFile;
3935
// Preserve all non-JS that were there in the included list.
4036
const included = files.included.filter(f => path.extname(f.originalPath) !== '.js');
4137
const bundledFiles =

packages/concatjs/web_test/test/stack_trace/test_sourcemap.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
OUTPUT=$(${RUNFILES_DIR}/build_bazel_rules_nodejs/packages/concatjs/web_test/test/stack_trace/karma_test_chromium-local.sh)
33

44
# Test whether the package relative TS path is printed in stack trace.
5-
echo ${OUTPUT} | grep -q "(packages/concatjs/web_test/test/stack_trace/failing.spec.ts:7:17"
5+
echo ${OUTPUT} | grep -q "(packages/concatjs/web_test/test/stack_trace/failing.spec.ts:7:18"
66
if [[ "$?" != "0" ]]; then
7-
echo "Did not find '(packages/concatjs/web_test/test/stack_trace/failing.spec.ts:7:17' in Karma stack trace"
7+
echo "Did not find '(packages/concatjs/web_test/test/stack_trace/failing.spec.ts:7:18' in Karma stack trace"
88
echo $OUTPUT
99
exit 1
1010
fi
1111

1212
# Test whether the package relative path inside a subdirectory is printed.
13-
echo ${OUTPUT} | grep -q "(packages/concatjs/web_test/test/stack_trace/test_folder/test.spec.ts:5:23"
13+
echo ${OUTPUT} | grep -q "(packages/concatjs/web_test/test/stack_trace/test_folder/test.spec.ts:5:24"
1414
if [[ "$?" != "0" ]]; then
15-
echo "Did not find '(packages/concatjs/web_test/test/stack_trace/test_folder/test.spec.ts:5:23' in Karma stack trace"
15+
echo "Did not find '(packages/concatjs/web_test/test/stack_trace/test_folder/test.spec.ts:5:24' in Karma stack trace"
1616
exit 1
1717
fi
1818

1919
# Test whether stack trace with multiple stack frames mapped get printed.
20-
echo ${OUTPUT} | grep -q "(packages/concatjs/web_test/test/stack_trace/test_folder/hello.ts:6:8"
20+
echo ${OUTPUT} | grep -q "(packages/concatjs/web_test/test/stack_trace/test_folder/hello.ts:6:9"
2121
if [[ "$?" != "0" ]]; then
22-
echo "Did not find '(packages/concatjs/web_test/test/stack_trace/test_folder/hello.ts:6:8' in Karma stack trace"
22+
echo "Did not find '(packages/concatjs/web_test/test/stack_trace/test_folder/hello.ts:6:9' in Karma stack trace"
2323
exit 1
2424
fi
2525

0 commit comments

Comments
 (0)