We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Trying to write tests based on this example using createTypeormDataSource.
createTypeormDataSource
FAIL src/controllers/order/order.service.spec.ts Order module ✕ Should work ● Order module › Should work TypeError: DataSource is not a constructor 50 | }) 51 | > 52 | const conn = await db.adapters.createTypeormDataSource({ | ^ 53 | type: 'postgres', 54 | entities: [Wallet, User, UserRole, Role, RolePermission, Permission, Session, UserSettings, ProductMiddleWallet, Product, NetworkCurrency, Network, Currency], 55 | }); at Adapters.createTypeormDataSource (node_modules/pg-mem/src/adapters/adapters.ts:208:25) at Object.createTypeormDataSource (src/controllers/order/order.service.spec.ts:52:36)
Also createTypeormConnection works fine beside another problem from my other issue.
createTypeormConnection
const db = newDb({ autoCreateForeignKeyIndices: true, }); db.public.registerFunction({ implementation: () => 'test', name: 'current_database', }); db.public.registerFunction({ name: 'version', args: [], returns: DataType.text, implementation: (x) => `hello world: ${x}` }) db.registerExtension('uuid-ossp', (schema) => { schema.registerFunction({ name: 'uuid_generate_v4', returns: DataType.uuid, implementation: v4, impure: true }) }) const conn = await db.adapters.createTypeormDataSource({ type: 'postgres', entities: [Wallet, User, UserRole, Role, RolePermission, Permission, Session, UserSettings, ProductMiddleWallet, Product, NetworkCurrency, Network, Currency], });
"pg-mem": "^2.7.2", "typeorm": "0.2.45", "pg": "^8.7.3",
The text was updated successfully, but these errors were encountered:
Actually problem because typeorm added DataSource class only in version 0.3.0 and higher.
DataSource
I think really matter update package json and update peer deps with 0.3.0 version of typeorm.
"peerDependencies": { "knex": ">=0.20", "pg-promise": ">=10.8.7", "slonik": ">=23.0.1", "typeorm": ">=0.2.29" // here },
And I think really matter to update wiki for usage pg-mem with typeorm.
https://github.com/oguimbal/pg-mem/wiki/Libraries-adapters#-typeorm
Change createTypeormConnection -> createTypeormDataSource.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Trying to write tests based on this example using
createTypeormDataSource
.Also
createTypeormConnection
works fine beside another problem from my other issue.To Reproduce
pg-mem version and another deps
The text was updated successfully, but these errors were encountered: