Commit 34fc79e0 authored by Robert Knight's avatar Robert Knight

Enable source-mapped error stacktraces in tests

See https://github.com/hypothesis/browser-extension/pull/681
parent 7de19607
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
"karma-mocha": "^2.0.0", "karma-mocha": "^2.0.0",
"karma-mocha-reporter": "^2.0.4", "karma-mocha-reporter": "^2.0.4",
"karma-sinon": "^1.0.5", "karma-sinon": "^1.0.5",
"karma-source-map-support": "^1.4.0",
"katex": "^0.13.0", "katex": "^0.13.0",
"lodash.debounce": "^4.0.3", "lodash.debounce": "^4.0.3",
"mocha": "9.1.2", "mocha": "9.1.2",
......
...@@ -13,6 +13,7 @@ export default { ...@@ -13,6 +13,7 @@ export default {
file: 'build/scripts/tests.bundle.js', file: 'build/scripts/tests.bundle.js',
format: 'iife', format: 'iife',
name: 'testsBundle', // This just exists to suppress a build warning. name: 'testsBundle', // This just exists to suppress a build warning.
sourcemap: true,
}, },
treeshake: false, treeshake: false,
plugins: [ plugins: [
......
...@@ -47,7 +47,7 @@ module.exports = function (config) { ...@@ -47,7 +47,7 @@ module.exports = function (config) {
// frameworks to use // frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon'], frameworks: ['mocha', 'chai', 'sinon', 'source-map-support'],
// list of files / patterns to load in the browser // list of files / patterns to load in the browser
files: [ files: [
...@@ -57,6 +57,9 @@ module.exports = function (config) { ...@@ -57,6 +57,9 @@ module.exports = function (config) {
// Test bundles. // Test bundles.
'../build/scripts/tests.bundle.js', '../build/scripts/tests.bundle.js',
// Sourcemaps for test bundles.
{ pattern: '../build/scripts/*.js.map', included: false },
// CSS bundles, relied upon by accessibility tests (eg. for color-contrast // CSS bundles, relied upon by accessibility tests (eg. for color-contrast
// checks). // checks).
{ {
......
...@@ -4835,6 +4835,13 @@ karma-sinon@^1.0.5: ...@@ -4835,6 +4835,13 @@ karma-sinon@^1.0.5:
resolved "https://registry.yarnpkg.com/karma-sinon/-/karma-sinon-1.0.5.tgz#4e3443f2830fdecff624d3747163f1217daa2a9a" resolved "https://registry.yarnpkg.com/karma-sinon/-/karma-sinon-1.0.5.tgz#4e3443f2830fdecff624d3747163f1217daa2a9a"
integrity sha1-TjRD8oMP3s/2JNN0cWPxIX2qKpo= integrity sha1-TjRD8oMP3s/2JNN0cWPxIX2qKpo=
karma-source-map-support@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz#58526ceccf7e8730e56effd97a4de8d712ac0d6b"
integrity sha512-RsBECncGO17KAoJCYXjv+ckIz+Ii9NCi+9enk+rq6XC81ezYkb4/RHE6CTXdA7IOJqoF3wcaLfVG0CPmE5ca6A==
dependencies:
source-map-support "^0.5.5"
karma@^6.0.1: karma@^6.0.1:
version "6.3.4" version "6.3.4"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.4.tgz#359899d3aab3d6b918ea0f57046fd2a6b68565e6" resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.4.tgz#359899d3aab3d6b918ea0f57046fd2a6b68565e6"
...@@ -6691,7 +6698,7 @@ source-map-resolve@^0.5.0: ...@@ -6691,7 +6698,7 @@ source-map-resolve@^0.5.0:
source-map-url "^0.4.0" source-map-url "^0.4.0"
urix "^0.1.0" urix "^0.1.0"
source-map-support@~0.5.20: source-map-support@^0.5.5, source-map-support@~0.5.20:
version "0.5.20" version "0.5.20"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9"
integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment