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
i expect other-item.spec.ts test run without error.
There is not test in this spec, and it fails as soon as importing fixture from other-item.fixture.ts
Actual behavior
When i run other-item.spec.ts with Jest/ts-jest, it raises an error
"Class extends value undefined is not a constructor or null".
OtherItem extends Item
^
Debug log
PASS src/tests/config-item-embellishment/config-item-embellishment.spec.ts
PASS src/tests/embellishment/embellishment.spec.ts
FAIL src/tests/other-item/other-item.spec.ts
● Test suite failed to run
TypeError: Class extends value undefined is not a constructor or null
1 | import { Item } from '../item/item';
2 |
> 3 | export class Embellishment extends Item {
| ^
4 | data: string = "data";
5 | constructor() {
6 | super();
at Object.<anonymous> (src/embellishment/embellishment.ts:3:36)
at Object.<anonymous> (src/config-item-embellishment/config-item-embellishment.ts:3:1)
at Object.<anonymous> (src/item/item.ts:3:1)
at Object.<anonymous> (src/other-item/other-item.ts:2:1)
at Object.<anonymous> (src/tests/other-item/other-item.fixture.ts:2:1)
at Object.<anonymous> (src/tests/other-item/other-item.spec.ts:2:1)
Test Suites: 1 failed, 2 passed, 3 total
Tests: 14 passed, 14 total
Snapshots: 0 total
Time: 3.892 s
npm run start
> [email protected] start
> nodemon --watch 'src/index.ts' --exec 'ts-node -r tsconfig-paths/register src/index.ts'
[nodemon] 3.1.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/index.ts
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `ts-node -r tsconfig-paths/register src/index.ts`
otherItem {"config":{"_someEmbellishment":[{"data":"data"}]}}
[nodemon] clean exit - waiting for changes before restart
Additional context
Even if there is circular dependency in Object modelization : The code is compiling and running (npm run start).
So Typescript/Javascript handle my code.
I handle this circular by defining config to 'undefined' for Embellishment Item.
Version
^29.2.3
Steps to reproduce
https://github.com/StoryDevOffical/TsJestCircular.git
Expected behavior
i expect other-item.spec.ts test run without error.
There is not test in this spec, and it fails as soon as importing fixture from other-item.fixture.ts
Actual behavior
When i run other-item.spec.ts with Jest/ts-jest, it raises an error
"Class extends value undefined is not a constructor or null".
OtherItem extends Item
^
Debug log
Additional context
Even if there is circular dependency in Object modelization : The code is compiling and running (npm run start).
So Typescript/Javascript handle my code.
I handle this circular by defining config to 'undefined' for Embellishment Item.
Here the object modelization.
Environment
The text was updated successfully, but these errors were encountered: