Add test to check debug IDs are in output and match

This commit is contained in:
Tim Fish 2024-11-14 13:59:37 +00:00
parent 5821a9b8ea
commit 2fa1a23fed
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,9 @@
it("source should include debug id that matches debugId key in sourcemap", function() {
var fs = require("fs");
var source = fs.readFileSync(__filename, "utf-8");
var sourceMap = fs.readFileSync(__filename + ".map", "utf-8");
var map = JSON.parse(sourceMap);
expect(map.debugId).toBeDefined();
expect(source).toContain(`//# debugId=${map.debugId}`);
});

View File

@ -0,0 +1,4 @@
/** @type {import("../../../../").Configuration} */
module.exports = {
devtool: "source-map-debugids"
};