test: use sourcemaps in unit tests (#6485)

Introduce the source-map-support package and require it for mocha running unit tests.

Turn on the sourceMap option for tsconfig.base.json so that the sourceMappingURL= line is emitted in the generated files.

Co-authored-by: Mathias Bynens <mathias@qiwi.be>
This commit is contained in:
Peter Marshall 2020-11-26 14:51:17 +01:00 committed by GitHub
parent fb859115c0
commit 46e74ff3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,11 @@ const base = require('./base');
module.exports = {
...base,
require: ['./test/mocha-ts-require', './test/mocha-utils.ts'],
require: [
'./test/mocha-ts-require',
'./test/mocha-utils.ts',
'source-map-support/register',
],
spec: 'test/*.spec.ts',
extension: ['js', 'ts'],
retries: process.env.CI ? 2 : 0,

View File

@ -96,6 +96,7 @@
"pngjs": "^5.0.0",
"prettier": "^2.1.2",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"standard-version": "^9.0.0",
"text-diff": "^1.0.1",
"ts-node": "^9.0.0",

View File

@ -8,6 +8,7 @@
"module": "ESNext",
"declaration": true,
"declarationMap": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"sourceMap": true,
}
}