CodersCrew / coderscamp

Monorepo containing CodersCamp's internal application, its website, and all development resources created around them.
https://www.coderscamp.edu.pl/
GNU General Public License v3.0
6 stars 3 forks source link

Fix tests on main branch - user registration #368

Closed MateuszNaKodach closed 2 years ago

MateuszNaKodach commented 2 years ago

https://github.com/CodersCrew/coderscamp/runs/3656554604

LOGS:

  Invalid `prisma.eventsSubscription.upsert()` invocation:

      Unique constraint failed on the fields: (`id`)

      240 |
      241 |   private async moveCurrentPosition(position: number, transaction: PrismaTransactionManager) {
    > 242 |     await transaction.eventsSubscription.upsert({
          |     ^
      243 |       where: {
      244 |         id: this.subscriptionId,
      245 |       },

      at cb (../../node_modules/@prisma/client/runtime/index.js:36940:17)
      at EventsSubscription.moveCurrentPosition (src/module/write/shared/application/events-subscription/events-subscription.ts:242:5)
      at EventsSubscription.handleEvent (src/module/write/shared/application/events-subscription/events-subscription.ts:199:7)
      at EventsSubscription.listen (src/module/write/shared/application/events-subscription/events-subscription.ts:143:9)
github-actions[bot] commented 2 years ago

Branch issue-368-Fix_tests_on_main_branch_user_registration created!

MateuszNaKodach commented 2 years ago

@htk4 Could you take a look? Do you have any idea what it's the cause of this issue?

hkawalek commented 2 years ago

I don't know why?, but it seems that this fixes issue.

afterEach(async () => {
    await module.close();
});