Skip to content

Commit

Permalink
chore: update to vitest@2 (#2379)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito authored Dec 5, 2024
1 parent 48e4c76 commit bd5f47c
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 414 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"json-bigint": "^1.0.0",
"lint-staged": "^15.2.10",
"page-with": "^0.6.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"regenerator-runtime": "^0.14.1",
"rimraf": "^6.0.1",
"simple-git-hooks": "^2.9.0",
Expand All @@ -202,7 +202,7 @@
"typescript": "^5.5.2",
"undici": "^6.20.0",
"url-loader": "^4.1.1",
"vitest": "^1.2.2",
"vitest": "^2.1.8",
"vitest-environment-miniflare": "^2.14.4",
"webpack": "^5.95.0",
"webpack-http-server": "^0.5.0"
Expand Down
556 changes: 166 additions & 390 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions test/node/graphql-api/response-patching.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const server = setupServer(

const httpServer = new HttpServer((app) => {
app.post('/graphql', async (req, res) => {
console.log('pass:', req.headers)

const result = await executeGraphql({
schema: buildSchema(gql`
type User {
Expand Down
6 changes: 5 additions & 1 deletion test/node/msw-api/auto-update-worker.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ describe.sequential(
const installCommand = await fsMock.exec(
`npm install msw-${packageJson.version}.tgz`,
)
expect(installCommand.stderr).toBe('')
/**
* @note Cannot assert on the empty stderr because npm
* writes to stderr if there's a new version of npm available.
*/
// expect(installCommand.stderr).toBe('')

expect(
fs.existsSync(fsMock.resolve('packages/one/mockServiceWorker.js')),
Expand Down
20 changes: 12 additions & 8 deletions test/typings/custom-handler.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ const generateGraphQLHandler: GraphQLRequestHandler = (
}

it('accepts custom request handler (setupWorker)', () => {
setupWorker(
generateHttpHandler('/', () => {}),
generateGraphQLHandler('GetResource', () => {}),
)
try {
setupWorker(
generateHttpHandler('/', () => {}),
generateGraphQLHandler('GetResource', () => {}),
)
} catch {}
})
it('accepts custom request handler (setupServer)', () => {
setupServer(
generateHttpHandler('/', () => {}),
generateGraphQLHandler('GetResource', () => {}),
)
try {
setupServer(
generateHttpHandler('/', () => {}),
generateGraphQLHandler('GetResource', () => {}),
)
} catch {}
})
3 changes: 0 additions & 3 deletions test/typings/index.test-d.cts

This file was deleted.

3 changes: 0 additions & 3 deletions test/typings/index.test-d.mts

This file was deleted.

3 changes: 0 additions & 3 deletions test/typings/index.test-d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions test/typings/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from 'node:path'
import fs from 'node:fs'
import path from 'node:path'
import { defineConfig } from 'vitest/config'
import tsPackageJson from 'typescript/package.json' assert { type: 'json' }
import { invariant } from 'outvariant'
import * as fs from 'fs'

const LIB_DIR = path.resolve(__dirname, '../../lib')

Expand Down

0 comments on commit bd5f47c

Please sign in to comment.