You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing something with that class, version is always undefined:
import { Model } from './model';
describe("failing class tests", () => {
it('should init class with all the values', () => {
const model = new Model({ id: '123', name: 'test', version: 1 });
expect(model.id).toEqual('123');
expect(model.name).toEqual('test');
expect(model.version).toEqual(1); // This fails, 'version' is undefined
})
})
This also works with Jasmine and in normal runtime.
when reproduce transpiled code and use it with test:
describe("failing class tests",()=>{it('should init class with all the values',()=>{constmodel=newModel({id: '123',name: 'test',version: 1});expect(model.id).toEqual('123');expect(model.name).toEqual('test');expect(model.version).toEqual(1);// This fails, 'version' is undefined})})
it works as expected, but when use with classes and interfaces, it not working any more and fails on "version": 1
Hello!
First of all, thanks a lot for the effort! This plugin has already incredible results in our huge project with more than 2000 tests.
The issue
When running our tests with plain Jest, everything works (but super slow 😉), but when running our tests with swc-angular this issue arises:
Looks like classes that extend from other class lose values of those properties that are not present in the parent class.
Example:
When testing something with that class,
version
is always undefined:This also works with Jasmine and in normal runtime.
Reproduction
https://github.com/santiagof4/jest-angular-swc-class-reproduction
npm install
nx test
The text was updated successfully, but these errors were encountered: