Skip to content

Commit

Permalink
test: unit test fails when using after msw 2.6.x (#187)
Browse files Browse the repository at this point in the history
test: unit test fails when using after msw 2.6.x
  • Loading branch information
duyhungtnn authored Nov 18, 2024
1 parent 8c6e6d4 commit c82a1d8
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 403 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.7.0
22.11.0
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@bucketeer/js-client-sdk": "workspace:*"
},
"devDependencies": {
"vite": "5.4.6",
"typescript": "5.5.4"
"vite": "5.4.11",
"typescript": "5.6.3"
}
}
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,24 @@
},
"devDependencies": {
"@types/jsdom": "21.1.7",
"@types/node": "20.16.3",
"@typescript-eslint/eslint-plugin": "8.4.0",
"@typescript-eslint/parser": "8.4.0",
"@types/node": "20.17.6",
"@typescript-eslint/eslint-plugin": "8.14.0",
"@typescript-eslint/parser": "8.14.0",
"@vitest/browser": "2.1.4",
"@vitest/utils": "2.1.4",
"cross-fetch": "4.0.0",
"eslint": "9.9.1",
"eslint": "9.14.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-prettier": "5.2.1",
"happy-dom": "15.7.3",
"jiti": "1.21.6",
"msw": "2.4.1",
"msw": "2.6.4",
"prettier": "3.3.3",
"typescript": "5.5.4",
"typescript-eslint": "8.4.0",
"typescript": "5.6.3",
"typescript-eslint": "8.14.0",
"unbuild": "2.0.0",
"vitest": "2.1.4",
"webdriverio": "9.2.12"
},
"packageManager": "pnpm@9.9.0"
"packageManager": "pnpm@9.12.3"
}
630 changes: 250 additions & 380 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/BKTClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
TestPlatformModule,
FakeClock,
} from './utils'
import fetch from 'cross-fetch'

import { user1 } from './mocks/users'
import {
InternalServerErrorException,
Expand Down
2 changes: 1 addition & 1 deletion test/internal/evaluation/EvaluationInteractor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
beforeAll,
afterAll,
} from 'vitest'
import fetch from 'cross-fetch'

import assert from 'assert'
import { BKTConfig, defineBKTConfig } from '../../../src/BKTConfig'
import { DefaultComponent } from '../../../src/internal/di/Component'
Expand Down
2 changes: 1 addition & 1 deletion test/internal/event/EventInteractor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert'
import { HttpResponse, http } from 'msw'
import { SetupServer } from 'msw/node'
import fetch from 'cross-fetch'

import {
expect,
suite,
Expand Down
7 changes: 2 additions & 5 deletions test/internal/remote/ApiClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
beforeAll,
vi,
} from 'vitest'
import fetch from 'cross-fetch'

import { HttpResponse, http, delay, StrictRequest } from 'msw'
import assert from 'assert'
import { SetupServer } from 'msw/node'
Expand Down Expand Up @@ -52,10 +52,7 @@ suite('internal/remote/ApiClient', () => {

suite('getEvaluations', () => {
test('success', async () => {
const requestInterceptor = vi.fn<
[StrictRequest<GetEvaluationsRequest>],
void
>()
const requestInterceptor = vi.fn((_request: StrictRequest<GetEvaluationsRequest>) => {})

server.use(
http.post<
Expand Down
2 changes: 1 addition & 1 deletion test/internal/scheduler/EvaluationTask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
afterAll,
beforeAll,
} from 'vitest'
import fetch from 'cross-fetch'

import { destroyBKTClient } from '../../../src/BKTClient'
import { BKTConfig, defineBKTConfig } from '../../../src/BKTConfig'
import { DefaultComponent } from '../../../src/internal/di/Component'
Expand Down
2 changes: 1 addition & 1 deletion test/internal/scheduler/EventTask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
afterAll,
describe,
} from 'vitest'
import fetch from 'cross-fetch'

import { destroyBKTClient } from '../../../src/BKTClient'
import { BKTConfig, defineBKTConfig } from '../../../src/BKTConfig'
import { DefaultComponent } from '../../../src/internal/di/Component'
Expand Down

0 comments on commit c82a1d8

Please sign in to comment.