-
Notifications
You must be signed in to change notification settings - Fork 250
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
4.0.0.Beta: Must call super constructor in derived class before accessing 'this' or returning from derived constructor #2474
Labels
🐛 Bug
Something isn't working
Comments
nicojs
added a commit
that referenced
this issue
Sep 13, 2020
nicojs
added a commit
that referenced
this issue
Sep 17, 2020
…lass properties Don't mutate constructor block statements when the class contains initialized class properties. Fixes #2474
nicojs
added a commit
that referenced
this issue
Sep 17, 2020
…lass properties (#2484) Don't mutate constructor block statements when the class contains initialized class properties. For example: ```ts class Foo extends Baz { bar = 'bar'; constructor() { // Don't mutate this block! super(); } } ``` If you mutate the constructor block above, and TypeScript transpiles the code, it will call `this.bar` before the `super()` is initiated. Resulting in a runtime error. Fixes #2474
Hi! export class BuyerRoute extends PbRoute {
#traveler: string;
constructor(input: BuyerRouteInput) {
super(input);
this.#traveler = input.traveler;
}
} Is still compiled by Stryker like that: export class BuyerRoute extends PbRoute {
#traveler: string;
constructor(input: BuyerRouteInput) {
if (stryMutAct_9fa48("647")) { {}
} else {
stryCov_9fa48("647");
super(input);
this.#traveler = input.traveler;
}
}
} Here my // @ts-check
/** @type {import('@stryker-mutator/api/core').PartialStrykerOptions} */
const config = {
_comment:
"This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information",
packageManager: "yarn",
reporters: ["html", "clear-text", "progress"],
testRunner: "jest",
coverageAnalysis: "perTest",
checkers: ["typescript"],
tsconfigFile: "tsconfig.json",
transpilers: [
"typescript", // Specify that your typescript code needs to be transpiled before tests can be run. Not needed if you're using ts-node Just-in-time compilation.
],
jest: {
projectType: "custom",
configFile: "./jest.config.ts",
enableFindRelatedTests: true,
},
disableTypeChecks: "{__tests__,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}",
};
export default config; |
This seems like old config, because i see you've configured |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running Stryker on its own
@stryker-mutator/karma-runner
, we now get this error:Cause:
This:
Is mutated to:
Which is then transpiled to:
The text was updated successfully, but these errors were encountered: