Skip to content

Commit

Permalink
Merge pull request #392 from bootstrapworld/pcardune-tests-i391
Browse files Browse the repository at this point in the history
Enable typescript for test files and fix sourcemaps
  • Loading branch information
Emmanuel Schanzer authored Sep 7, 2021
2 parents 168659f + af8727e commit 319833e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
2 changes: 1 addition & 1 deletion spec/comment-test.js → spec/comment-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
3 changes: 0 additions & 3 deletions spec/index.js

This file was deleted.

7 changes: 7 additions & 0 deletions spec/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"include": ["./**/*"],
"compilerOptions": {
"allowJs": true
}
}
6 changes: 6 additions & 0 deletions src/toolkit/karma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
};
}

Expand Down

0 comments on commit 319833e

Please sign in to comment.