Skip to content

Commit

Permalink
chore(deps): update dependency vitest to v2 (#11021)
Browse files Browse the repository at this point in the history
See: #11014. This PR is just a copy of that with the necessary tweaks.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
Josh-Walker-GM and renovate[bot] authored Jul 20, 2024
1 parent 40b755d commit 7faef97
Show file tree
Hide file tree
Showing 54 changed files with 254 additions and 254 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"tstyche": "2.1.0",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0",
"vitest": "2.0.3",
"yargs": "17.7.2",
"zx": "8.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/adapters/fastify/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fastify": "4.28.1",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"pino-abstract-transport": "1.2.0",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"@redwoodjs/graphql-server": "workspace:*"
Expand Down
10 changes: 2 additions & 8 deletions packages/api-server/src/__tests__/createServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ afterAll(() => {
process.env.RWJS_CWD = original_RWJS_CWD
})

let consoleWarnSpy: MockInstance<
Parameters<typeof console.warn>,
ReturnType<typeof console.warn>
>
let consoleLogSpy: MockInstance<
Parameters<typeof console.log>,
ReturnType<typeof console.log>
>
let consoleWarnSpy: MockInstance<typeof console.warn>
let consoleLogSpy: MockInstance<typeof console.log>

describe('createServer', () => {
// Create a server for most tests. Some that test initialization create their own
Expand Down
1 change: 1 addition & 0 deletions packages/api-server/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export default defineConfig({
...configDefaults.exclude,
'**/fixtures',
],
pool: 'threads'
},
})
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"split2": "4.2.0",
"ts-toolbelt": "9.6.0",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"memjs": "1.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@redwoodjs/api": "workspace:*",
"@types/jsonwebtoken": "9.0.6",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/core": "^7.22.20",
"@types/yargs": "17.0.32",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/react": "^18.2.55",
"react": "19.0.0-beta-04b058868c-20240508",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"@auth0/auth0-spa-js": "2.1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/aws-lambda": "8.10.141",
"@types/jsonwebtoken": "9.0.6",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/core": "^7.22.20",
"@types/yargs": "17.0.32",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/react": "^18.2.55",
"react": "19.0.0-beta-04b058868c-20240508",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"@azure/msal-browser": "2.39.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/clerk/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@redwoodjs/api": "workspace:*",
"@types/aws-lambda": "8.10.141",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/clerk/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/react": "^18.2.55",
"react": "19.0.0-beta-04b058868c-20240508",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"@clerk/clerk-react": "4.32.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/custom/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/core": "^7.22.20",
"@types/yargs": "17.0.32",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/md5": "2.3.5",
"@types/uuid": "9.0.8",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"ts-toolbelt": "9.6.0",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@redwoodjs/api": "workspace:*",
"@types/aws-lambda": "8.10.141",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/core": "^7.22.20",
"@types/yargs": "17.0.32",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/netlify/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/aws-lambda": "8.10.141",
"@types/jsonwebtoken": "9.0.6",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/netlify/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@babel/core": "^7.22.20",
"@types/yargs": "17.0.32",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/netlify/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/react": "^18.2.55",
"react": "19.0.0-beta-04b058868c-20240508",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"netlify-identity-widget": "1.9.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/supabase/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/aws-lambda": "8.10.141",
"@types/jsonwebtoken": "9.0.6",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/supabase/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"ts-toolbelt": "9.6.0",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/supabase/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/react": "^18.2.55",
"react": "19.0.0-beta-04b058868c-20240508",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"@supabase/supabase-js": "2.44.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/supertokens/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@redwoodjs/api": "workspace:*",
"@types/jsonwebtoken": "9.0.6",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"supertokens-node": "15.2.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/supertokens/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/yargs": "17.0.32",
"memfs": "4.9.3",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/auth-providers/supertokens/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"react": "19.0.0-beta-04b058868c-20240508",
"supertokens-auth-react": "0.39.1",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"peerDependencies": {
"supertokens-auth-react": "0.39.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"tsx": "4.16.2",
"type-fest": "4.22.1",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/babel-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/node": "20.14.11",
"babel-plugin-tester": "11.0.4",
"tsx": "4.16.2",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/cli-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@types/yargs": "17.0.32",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
4 changes: 4 additions & 0 deletions packages/cli-helpers/src/lib/__tests__/project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ describe('addEnvVar', () => {
return true
})

// @ts-expect-error We're only returning a string rather than the expected Buffer | string
// which is determined by the options parameter passed to the real fs.readFileSync
vi.spyOn(fs, 'readFileSync').mockImplementation(() => {
return envFileContent
})
Expand Down Expand Up @@ -132,6 +134,8 @@ describe('updateTomlConfig', () => {
return true
})

// @ts-expect-error We're only returning a string rather than the expected Buffer | string
// which is determined by the options parameter passed to the real fs.readFileSync
vi.spyOn(fs, 'readFileSync').mockImplementation(() => {
return toml.stringify(defaultRedwoodToml)
})
Expand Down
24 changes: 12 additions & 12 deletions packages/cli-helpers/src/lib/__tests__/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ describe('version compatibility detection', () => {
} as any
})

vi.spyOn(fs, 'readFileSync').mockImplementation(() => {
return JSON.stringify({
vi.spyOn(fs, 'readFileSync').mockReturnValue(
JSON.stringify({
devDependencies: {
'@redwoodjs/core': '^6.0.0',
},
})
})
}),
)
})

test('throws for some fetch related error', async () => {
Expand Down Expand Up @@ -326,13 +326,13 @@ describe('version compatibility detection', () => {
},
)

vi.spyOn(fs, 'readFileSync').mockImplementation(() => {
return JSON.stringify({
vi.spyOn(fs, 'readFileSync').mockReturnValue(
JSON.stringify({
devDependencies: {
'@redwoodjs/core': '5.2.0',
},
})
})
}),
)

expect(await getCompatibilityData('@scope/package-name', 'latest')).toEqual(
{
Expand All @@ -349,13 +349,13 @@ describe('version compatibility detection', () => {
})

test('throws if no compatible version could be found', async () => {
vi.spyOn(fs, 'readFileSync').mockImplementation(() => {
return JSON.stringify({
vi.spyOn(fs, 'readFileSync').mockReturnValue(
JSON.stringify({
devDependencies: {
'@redwoodjs/core': '7.0.0',
},
})
})
}),
)

expect(
getCompatibilityData('@scope/package-name', 'latest'),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"memfs": "4.9.3",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@types/yargs": "17.0.32",
"fs-extra": "11.2.0",
"tempy": "1.0.1",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
2 changes: 1 addition & 1 deletion packages/create-redwood-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"tsx": "4.16.2",
"untildify": "4.0.0",
"uuid": "9.0.1",
"vitest": "1.6.0",
"vitest": "2.0.3",
"yargs": "17.7.2"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@typescript-eslint/rule-tester": "7.3.1",
"tsx": "4.16.2",
"typescript": "5.4.5",
"vitest": "1.6.0"
"vitest": "2.0.3"
},
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
}
Loading

0 comments on commit 7faef97

Please sign in to comment.