-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ECMAScript Modules with multi spec can not debug #12075
Comments
Sorry, I don't follow to example. Could you put together a reproduction I can pull down and run? |
//b.spec.ts
import { angularCompilerPromise, getAngularCompiler } from "./load_esm";
describe("aaaa", () => {
it("bbbb", async () => {
let result = await getAngularCompiler();
console.log(result);
console.log("222");
});
}); // a.spec.ts
describe("", () => {
it("", () => {
console.log("111");
});
}); //load_esm.ts
export async function loadEsmModule<T>(modulePath: string): Promise<T> {
const namespaceObject = await new Function("modulePath", `return import(modulePath);`)(modulePath);
// If it is not ESM then the values needed will be stored in the `default` property.
// TODO_ESM: This can be removed once `@angular/*` packages are ESM only.
if (namespaceObject.default) {
return namespaceObject.default;
} else {
return namespaceObject;
}
}
export function getAngularCompiler() {
return loadEsmModule<any>("@angular/compiler");
}
export const angularCompilerPromise = getAngularCompiler();
export const angularCompilerCliPromise = loadEsmModule<any>("@angular/compiler-cli"); //jest.config.ts
export default {
clearMocks: true,
collectCoverage: true,
coverageDirectory: "coverage",
coverageProvider: "v8",
moduleFileExtensions: ["js", "ts"],
transform: {
"^.+\\.(t|j)s$": "ts-jest",
},
testRunner: "jasmine2",
}; "scripts": {
"test": "NODE_OPTIONS=\"--experimental-vm-modules --inspect-brk\" jest",
}, when delete |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Getting same issue |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
27.3.1
Steps to reproduce
npm script: {"test": "NODE_OPTIONS="--experimental-vm-modules --inspect-brk" jest"}
launch.json
when spec pattern match only one(not xdescribe,is one file one describe)
I can debug one spec
when spec pattern match multi will throw error and can't debug
but I add
--experimental-vm-modules
flag and run success on one spec one describe.Expected behavior
multi spec file also run success
Actual behavior
only match one spec can run success
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: