Skip to content
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

feat: resolve & convert circular dependent Js plain object to Js class instance #1625

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run ts file one click with tsx (globally installed, faster)",
"runtimeExecutable": "tsx",
"runtimeArgs": [],
"program": "${file}",
"args": [],
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
],
// "stopOnEntry": true,
}
]
}
26 changes: 20 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
module.exports = {
export default {
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverageFrom: ['src/**/*.ts', '!src/**/index.ts', '!src/**/*.interface.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.spec.json',
},
// globals: {
// 'ts-jest': {
// tsconfig: 'tsconfig.spec.json',
// },
// },
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
},
],
// ;not_working; '^ResolveCircularDependenyWhenPlainToClass\\.spec\\.ts$': [
// ;not_working; 'ts-jest',
// ;not_working; {
// ;not_working; tsconfig: 'tsconfig.spec.circularDep.json',
// ;not_working; },
// ;not_working; ],
},
};
};
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,28 @@
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.0",
"@types/jest": "^27.5.0",
"@types/jest": "^29.5.5",
"@types/node": "^20.5.1",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^26.8.7",
"husky": "^4.3.8",
"jest": "^26.6.3",
"jest": "^29.7.0",
"lint-staged": "^14.0.1",
"prettier": "^2.8.8",
"reflect-metadata": "0.1.13",
"rimraf": "5.0.1",
"rollup": "^2.79.1",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^26.5.6",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
}
"tsx": "^3.13.0",
"typescript": "^4.9.5",
"flatted": "^3.2.9"
},
"dependencies": {
},
"type": "module"
}
Loading