diff --git a/karma.conf.js b/karma.conf.js index 63dbb2da9..d74f09da1 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -6,6 +6,5 @@ module.exports = (config) => { toolkitConfig.webpack.resolve.alias = { 'codemirror-blocks': path.resolve(__dirname, 'src'), }; - toolkitConfig.files = ["spec/index.js"]; config.set(toolkitConfig); }; diff --git a/spec/comment-test.js b/spec/comment-test.ts similarity index 96% rename from spec/comment-test.js rename to spec/comment-test.ts index 2e2212771..83d3f2d79 100644 --- a/spec/comment-test.js +++ b/spec/comment-test.ts @@ -4,7 +4,7 @@ import wescheme from '../src/languages/wescheme'; import { mac, cmd_ctrl, wait, removeEventListeners, teardown, activationSetup, click, mouseDown, mouseenter, mouseover, mouseleave, doubleClick, blur, - paste, cut, copy, dragstart, dragover, drop, dragenter, dragenterSeq, + paste, cut, dragstart, dragover, drop, dragenter, dragenterSeq, dragend, dragleave, keyDown, keyPress, insertText, finishRender } from '../src/toolkit/test-utils'; diff --git a/spec/index.js b/spec/index.js deleted file mode 100644 index c9d630c2c..000000000 --- a/spec/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// require all the files in the spec folder that end with -test.js -var context = require.context('.', true, /.-test\.js$/); -context.keys().forEach(context); \ No newline at end of file diff --git a/spec/tsconfig.json b/spec/tsconfig.json new file mode 100644 index 000000000..6a694b00a --- /dev/null +++ b/spec/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "allowJs": true + } +} \ No newline at end of file diff --git a/src/toolkit/karma.ts b/src/toolkit/karma.ts index 288647e0f..a92ad2f91 100644 --- a/src/toolkit/karma.ts +++ b/src/toolkit/karma.ts @@ -40,6 +40,12 @@ function getWebpackTestConfig(basePath: string, runCoverage: boolean): webpack.C 'process.env': { NODE_ENV: JSON.stringify('development') }, }), ], + // TODO: remove this workaround to sourcemaps being broken in + // karma-webpack version 5. See this github issue: + // https://github.com/ryanclark/karma-webpack/issues/493 + optimization: { + splitChunks: false, + } }; }