Skip to content

MaximeDan is pushing #102

MaximeDan is pushing

MaximeDan is pushing #102

GitHub Actions / Jest tests failed Jun 25, 2024 in 1s

21 passed, 9 failed and 0 skipped

Tests failed

❌ ./reports/junit/js-test-results.xml

30 tests were completed in 2s with 21 passed, 9 failed and 0 skipped.

Test suite Passed Failed Skipped Time
NextAuth API 1✅ 1❌ 370ms
registerSchema 18✅ 108ms
undefined 2✅ 8❌ 876ms

❌ NextAuth API

NextAuth API signs in with valid credentials
  ✅ NextAuth API signs in with valid credentials
NextAuth API fails to sign in with invalid credentials
  ❌ NextAuth API fails to sign in with invalid credentials
	SyntaxError: Unexpected end of JSON input

✅ registerSchema

registerSchema validates a correct user registration input
  ✅ registerSchema validates a correct user registration input
registerSchema fails validation with invalid email format
  ✅ registerSchema fails validation with invalid email format
registerSchema fails validation with name longer than 255 characters
  ✅ registerSchema fails validation with name longer than 255 characters
registerSchema fails validation with password missing uppercase letter
  ✅ registerSchema fails validation with password missing uppercase letter
registerSchema fails validation with password missing number
  ✅ registerSchema fails validation with password missing number
registerSchema fails validation with password missing special character
  ✅ registerSchema fails validation with password missing special character
registerSchema fails validation with password shorter than 8 characters
  ✅ registerSchema fails validation with password shorter than 8 characters
registerSchema fails validation with passwords not matching
  ✅ registerSchema fails validation with passwords not matching
registerSchema fails validation with missing required fields
  ✅ registerSchema fails validation with missing required fields
registerSchema fails validation with invalid date of birth
  ✅ registerSchema fails validation with invalid date of birth
registerSchema fails validation with date of birth in the future
  ✅ registerSchema fails validation with date of birth in the future
registerSchema fails validation with whitespace in required fields
  ✅ registerSchema fails validation with whitespace in required fields
registerSchema fails validation with password exactly 8 characters but lacking complexity
  ✅ registerSchema fails validation with password exactly 8 characters but lacking complexity
registerSchema fails validation with password including spaces
  ✅ registerSchema fails validation with password including spaces
registerSchema validates username case insensitivity
  ✅ registerSchema validates username case insensitivity
registerSchema validates email case insensitivity
  ✅ registerSchema validates email case insensitivity
registerSchema fails validation with email containing leading or trailing spaces
  ✅ registerSchema fails validation with email containing leading or trailing spaces
registerSchema fails validation with non-string input for string fields
  ✅ registerSchema fails validation with non-string input for string fields

❌ undefined

 registers a new user successfully
  ✅ registers a new user successfully
 returns error for already used email
  ✅ returns error for already used email
 returns error for bad request
  ❌ returns error for bad request
	Error: expect(received).toEqual(expected) // deep equality
 returns error for invalid date of birth
  ❌ returns error for invalid date of birth
	Error: expect(received).toEqual(expected) // deep equality
 returns error for future date of birth
  ❌ returns error for future date of birth
	Error: expect(received).toEqual(expected) // deep equality
 returns error for missing name
  ❌ returns error for missing name
	Error: expect(received).toEqual(expected) // deep equality
 returns error for invalid email format
  ❌ returns error for invalid email format
	Error: expect(received).toEqual(expected) // deep equality
 returns error for weak password
  ❌ returns error for weak password
	Error: expect(received).toEqual(expected) // deep equality
 returns error for whitespace in required fields
  ❌ returns error for whitespace in required fields
	Error: expect(received).toEqual(expected) // deep equality
 returns error for mismatched passwords
  ❌ returns error for mismatched passwords
	Error: expect(received).toEqual(expected) // deep equality

Annotations

Check failure on line 66 in __test__/auth/loginUser.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

NextAuth API ► NextAuth API fails to sign in with invalid credentials ► NextAuth API fails to sign in with invalid credentials

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  SyntaxError: Unexpected end of JSON input
Raw output
SyntaxError: Unexpected end of JSON input
    at parse (<anonymous>)
    at JSON.parse (/home/runner/work/Patrigma/Patrigma/node_modules/core-js/modules/esnext.json.parse.js:249:56)
    at _Response.communication.json (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:333:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async test (/home/runner/work/Patrigma/Patrigma/__test__/auth/loginUser.test.ts:66:22)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/loginUser.test.ts:51:5)

Check failure on line 89 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for bad request ► returns error for bad request

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 15
+ Received  +  2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Ce champ est requis",
-       "path": "username",
-     },
-     ObjectContaining {
-       "message": "Ce champ est requis",
-       "path": "dateOfBirth",
-     },
-     ObjectContaining {
-       "message": "Email invalide",
-       "path": "email",
-     },
-   ],
+ Object {
+   "message": "Error at username: Ce champ est requis (expected string, received** undefined); Error at dateOfBirth: Date invalide; Error at dateOfBirth: La date ne peut pas être dans le futur; Error at email: Email invalide (validation: email)",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:89:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:72:3)

Check failure on line 131 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for invalid date of birth ► returns error for invalid date of birth

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Date invalide",
-       "path": "dateOfBirth",
-     },
-   ],
+ Object {
+   "message": "Error at dateOfBirth: Date invalide; Error at dateOfBirth: La date ne peut pas être dans le futur",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:131:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:112:3)

Check failure on line 165 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for future date of birth ► returns error for future date of birth

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "La date ne peut pas être dans le futur",
-       "path": "dateOfBirth",
-     },
-   ],
+ Object {
+   "message": "Error at dateOfBirth: La date ne peut pas être dans le futur",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:165:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:146:3)

Check failure on line 198 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for missing name ► returns error for missing name

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Ce champ est requis",
-       "path": "name",
-     },
-   ],
+ Object {
+   "message": "Error at name: Ce champ est requis (expected string, received** undefined)",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:198:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:180:3)

Check failure on line 232 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for invalid email format ► returns error for invalid email format

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Email invalide",
-       "path": "email",
-     },
-   ],
+ Object {
+   "message": "Error at email: Email invalide (validation: email)",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:232:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:213:3)

Check failure on line 266 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for weak password ► returns error for weak password

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Veuillez renseigner au moins une lettre majuscule",
-       "path": "password",
-     },
-   ],
+ Object {
+   "message": "Error at password: Veuillez renseigner au moins une lettre majuscule; Error at password: Veuillez renseigner au moins un chiffre; Error at password: Veuillez renseigner au moins un caractère spécial; Error at confirmPassword: Veuillez renseigner au moins une lettre majuscule; Error at confirmPassword: Veuillez renseigner au moins un chiffre; Error at confirmPassword: Veuillez renseigner au moins un caractère spécial",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:266:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:247:3)

Check failure on line 300 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for whitespace in required fields ► returns error for whitespace in required fields

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Ce champ est requis",
-       "path": StringMatching /^(name|lastName|username)$/,
-     },
-   ],
+ Object {
+   "message": "Error at name: Ce champ est requis; Error at lastName: Ce champ est requis; Error at username: Ce champ est requis",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:300:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:281:3)

Check failure on line 334 in __test__/auth/apiClient/registerUserApi.test.ts

See this annotation in the file changed.

@github-actions github-actions / Jest tests

undefined ► returns error for mismatched passwords ► returns error for mismatched passwords

Failed test found in:
  ./reports/junit/js-test-results.xml
Error:
  Error: expect(received).toEqual(expected) // deep equality
Raw output
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 7
+ Received  + 2

- ObjectContaining {
-   "errors": ArrayContaining [
-     ObjectContaining {
-       "message": "Les mots de passe ne correspondent pas",
-       "path": "confirmPassword",
-     },
-   ],
+ Object {
+   "message": "Error at confirmPassword: Les mots de passe ne correspondent pas",
  }
    at test (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:334:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async testApiHandler (/home/runner/work/Patrigma/Patrigma/node_modules/next-test-api-route-handler/dist/src/index.js:125:5)
    at async Object.<anonymous> (/home/runner/work/Patrigma/Patrigma/__test__/auth/apiClient/registerUserApi.test.ts:315:3)