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 running the unit tests in the default version, the auth.test.ts fails:
` src/tests/auth.test.ts:25:36 - error TS2339: Property 'path' does not exist on type 'AuthRoute'.
25 .post(`${authRoute.path}/signup`)
~~~~
src/tests/auth.test.ts:41:36 - error TS2339: Property 'path' does not exist on type 'AuthRoute'.
41 .post(`${authRoute.path}/login`)
~~~~
src/tests/auth.test.ts:53:36 - error TS2339: Property 'path' does not exist on type 'AuthRoute'.
53 .post(`${authRoute.path}/logout`)`
Even if this compilation error is fixed, the tests still fail:
FAIL src/tests/auth.test.ts (7.321 s)
● Testing Auth › [POST] /login › response should have the Set-Cookie header with the Authorization token
expected "Set-Cookie" header field
at Test._assertHeader (node_modules/supertest/lib/test.js:237:45)
at Test._assertFunction (node_modules/supertest/lib/test.js:283:11)
at Test.assert (node_modules/supertest/lib/test.js:173:18)
at Server.localAssert (node_modules/supertest/lib/test.js:131:12)
expected "Set-Cookie" header field
at Test._assertHeader (node_modules/supertest/lib/test.js:237:45)
at Test._assertFunction (node_modules/supertest/lib/test.js:283:11)
at Test.assert (node_modules/supertest/lib/test.js:173:18)
at Server.localAssert (node_modules/supertest/lib/test.js:131:12)
In the sequelize template I get the following:
FAIL src/tests/auth.test.ts
● Test suite failed to run
src/tests/users.test.ts:15:13 - error TS2740: Type 'typeof User' is missing the following properties from type 'User[]': pop, push, concat, join, and 25 more.
15 const findUser: User[] = userModel;
~~~~~~~~
src/tests/users.test.ts:28:40 - error TS2339: Property 'find' does not exist on type 'typeof User'.
28 const findUser: User = userModel.find(user => user.id === userId);
~~~~
src/tests/users.test.ts:28:45 - error TS7006: Parameter 'user' implicitly has an 'any' type.
28 const findUser: User = userModel.find(user => user.id === userId);
~~~~
src/tests/users.test.ts:74:44 - error TS2339: Property 'filter' does not exist on type 'typeof User'.
74 const deleteUser: User[] = userModel.filter(user => user.id !== userId);
~~~~~~
src/tests/users.test.ts:74:51 - error TS7006: Parameter 'user' implicitly has an 'any' type.
74 const deleteUser: User[] = userModel.filter(user => user.id !== userId);
~~~~
FAIL src/tests/users.test.ts
● Test suite failed to run
src/models/index.model.ts:25:22 - error TS2769: No overload matches this call.
The last overload gave the following error.
Type 'typeof User' is not assignable to type 'string | ModelCtor<Model<any, any>>'.
Type 'typeof User' is not assignable to type 'ModelCtor<Model<any, any>>'.
Type 'typeof User' is not assignable to type 'typeof Model'.
Construct signature return types 'User' and 'Model<T, T2>' are incompatible.
The types of '_attributes' are incompatible between these types.
Type 'User' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'User'.
25 sequelize.addModels([User]);
~~~~
node_modules/sequelize-typescript/dist/sequelize/sequelize/sequelize.d.ts:16:5
16 addModels(arg: Array<ModelCtor | string>): any;
~~~~~~~~~
The last overload is declared here.
FAIL src/tests/index.test.ts
● Test suite failed to run
TypeError: Cannot read property 'getQueryInterface' of undefined
at Function.get queryInterface [as queryInterface] (node_modules/sequelize/lib/model.js:55:27)
at isFunctionMember (node_modules/sequelize-typescript/dist/model/model/model.js:99:25)
at node_modules/sequelize-typescript/dist/model/model/model.js:96:5
at Array.filter (<anonymous>)
at Object.<anonymous> (node_modules/sequelize-typescript/dist/model/model/model.js:95:6)
at Object.<anonymous> (node_modules/sequelize-typescript/dist/model/shared/model-service.js:3:17)
I've not tried the mongoose version, but I'm guessing that will have similiar issues. I'm guessing these are still work in progress.
The text was updated successfully, but these errors were encountered:
When running the unit tests in the default version, the auth.test.ts fails:
` src/tests/auth.test.ts:25:36 - error TS2339: Property 'path' does not exist on type 'AuthRoute'.
Even if this compilation error is fixed, the tests still fail:
FAIL src/tests/auth.test.ts (7.321 s)
● Testing Auth › [POST] /login › response should have the Set-Cookie header with the Authorization token
● Testing Auth › [POST] /logout › logout Set-Cookie Authorization=; Max-age=0
In the sequelize template I get the following:
FAIL src/tests/auth.test.ts
● Test suite failed to run
FAIL src/tests/users.test.ts
● Test suite failed to run
FAIL src/tests/index.test.ts
● Test suite failed to run
I've not tried the mongoose version, but I'm guessing that will have similiar issues. I'm guessing these are still work in progress.
The text was updated successfully, but these errors were encountered: