mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 17:54:15 +03:00
test(es/plugin): Reenable compat test (#5969)
This commit is contained in:
parent
f655488cfa
commit
ca38a7027e
@ -80,8 +80,7 @@ describe("Published plugins", () => {
|
||||
experimental: {
|
||||
plugins: [
|
||||
["@swc/plugin-jest", {}],
|
||||
// Disabled because this plugin is broken
|
||||
// ["swc-plugin-coverage-instrument", {}],
|
||||
["swc-plugin-coverage-instrument", {}],
|
||||
],
|
||||
},
|
||||
},
|
||||
@ -94,7 +93,51 @@ describe("Published plugins", () => {
|
||||
);
|
||||
|
||||
expect(code).toMatchInlineSnapshot(`
|
||||
"console.log(\\"hello world\\");
|
||||
"function cov_8828012090449151314() {
|
||||
var path = \\"unknown.js\\";
|
||||
var hash = \\"7618951444430927811\\";
|
||||
var global = new ((function(){}).constructor)(\\"return this\\")();
|
||||
var gcv = \\"__coverage__\\";
|
||||
var coverageData = {
|
||||
all: false,
|
||||
path: \\"unknown.js\\",
|
||||
statementMap: {
|
||||
\\"0\\": {
|
||||
start: {
|
||||
line: 1,
|
||||
column: 0
|
||||
},
|
||||
end: {
|
||||
line: 1,
|
||||
column: 26
|
||||
}
|
||||
}
|
||||
},
|
||||
fnMap: {},
|
||||
branchMap: {},
|
||||
s: {
|
||||
\\"0\\": 0
|
||||
},
|
||||
f: {},
|
||||
b: {},
|
||||
_coverageSchema: \\"11020577277169172593\\",
|
||||
hash: \\"7618951444430927811\\"
|
||||
};
|
||||
var coverage = global[gcv] || (global[gcv] = {});
|
||||
if (!coverage[path] || coverage[path].hash !== hash) {
|
||||
coverage[path] = coverageData;
|
||||
}
|
||||
var actualCoverage = coverage[path];
|
||||
{
|
||||
cov_8828012090449151314 = function cov_8828012090449151314() {
|
||||
return actualCoverage;
|
||||
};
|
||||
}
|
||||
return actualCoverage;
|
||||
}
|
||||
cov_8828012090449151314();
|
||||
cov_8828012090449151314().s[0]++;
|
||||
console.log(\\"hello world\\");
|
||||
"
|
||||
`);
|
||||
});
|
||||
|
@ -134,7 +134,7 @@
|
||||
"source-map": "^0.7.3",
|
||||
"source-map-support": "^0.5.19",
|
||||
"sourcemap-validator": "^2.1.0",
|
||||
"swc-plugin-coverage-instrument": "^0.0.12",
|
||||
"swc-plugin-coverage-instrument": "^0.0.13",
|
||||
"terser": "^5.7.1",
|
||||
"ts-node": "^10.5.0",
|
||||
"typescript": "^4.5.2"
|
||||
|
Loading…
Reference in New Issue
Block a user