Skip to content

Commit 81b787f

Browse files
committed
Merge branch 'main' of github.com:redwoodjs/redwood into feat/dbauth-fetch-handler
* 'main' of github.com:redwoodjs/redwood: chore(auth-providers): switch to vitest (mostly) (redwoodjs#9869) chore(esm): convert `@redwoodjs/project-config` to ESM (redwoodjs#9870) fix(createServer): use addHook instead of ready (redwoodjs#9871)
2 parents d35207f + 352af62 commit 81b787f

101 files changed

Lines changed: 428 additions & 563 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/api-server/src/plugins/graphql.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,16 @@ export async function redwoodFastifyGraphQLServer(
115115
})
116116
}
117117

118-
fastify.ready(() => {
118+
fastify.addHook('onReady', (done) => {
119119
console.info(`GraphQL Yoga Server endpoint at ${yoga.graphqlEndpoint}`)
120120
console.info(
121121
`GraphQL Yoga Server Health Check endpoint at ${yoga.graphqlEndpoint}/health`
122122
)
123123
console.info(
124124
`GraphQL Yoga Server Readiness endpoint at ${yoga.graphqlEndpoint}/readiness`
125125
)
126+
127+
done()
126128
})
127129

128130
done()

packages/auth-providers/auth0/api/jest.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/auth-providers/auth0/api/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"build:types": "tsc --build --verbose",
2020
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"",
2121
"prepublishOnly": "NODE_ENV=production yarn build",
22-
"test": "jest src",
23-
"test:watch": "yarn test --watch"
22+
"test": "vitest run src",
23+
"test:watch": "vitest watch src"
2424
},
2525
"dependencies": {
2626
"@babel/runtime-corejs3": "7.23.6",
@@ -33,8 +33,8 @@
3333
"@babel/core": "^7.22.20",
3434
"@redwoodjs/api": "6.0.7",
3535
"@types/jsonwebtoken": "9.0.5",
36-
"jest": "29.7.0",
37-
"typescript": "5.3.3"
36+
"typescript": "5.3.3",
37+
"vitest": "1.2.1"
3838
},
3939
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
4040
}

packages/auth-providers/auth0/api/src/__tests__/auth0.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import jwt from 'jsonwebtoken'
2+
import { vi, test, expect } from 'vitest'
23

34
import { verifyAuth0Token } from '../decoder'
45

5-
jest.mock('jsonwebtoken', () => ({
6-
verify: jest.fn(),
7-
decode: jest.fn(),
6+
vi.mock('jsonwebtoken', () => ({
7+
default: {
8+
verify: vi.fn(),
9+
decode: vi.fn(),
10+
},
811
}))
912

1013
test('verify, and not decode, should be called in production', () => {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig, configDefaults } from 'vitest/config'
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: [...configDefaults.exclude, '**/fixtures'],
6+
},
7+
})

packages/auth-providers/auth0/setup/jest.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/auth-providers/auth0/setup/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"build:types": "tsc --build --verbose",
2020
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"",
2121
"prepublishOnly": "NODE_ENV=production yarn build",
22-
"test": "jest src",
23-
"test:watch": "yarn test --watch"
22+
"test": "vitest run src",
23+
"test:watch": "vitest watch src"
2424
},
2525
"dependencies": {
2626
"@babel/runtime-corejs3": "7.23.6",
@@ -31,8 +31,8 @@
3131
"@babel/cli": "7.23.4",
3232
"@babel/core": "^7.22.20",
3333
"@types/yargs": "17.0.32",
34-
"jest": "29.7.0",
35-
"typescript": "5.3.3"
34+
"typescript": "5.3.3",
35+
"vitest": "1.2.1"
3636
},
3737
"gitHead": "3905ed045508b861b495f8d5630d76c7a157d8f1"
3838
}

packages/auth-providers/auth0/setup/src/__tests__/setup.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { vi, test, expect } from 'vitest'
2+
13
import { command, description, builder, handler } from '../setup'
24

35
// mock Telemetry for CLI commands so they don't try to spawn a process
4-
jest.mock('@redwoodjs/telemetry', () => {
6+
vi.mock('@redwoodjs/telemetry', () => {
57
return {
68
errorTelemetry: () => jest.fn(),
79
timedTelemetry: () => jest.fn(),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig, configDefaults } from 'vitest/config'
2+
3+
export default defineConfig({
4+
test: {
5+
exclude: [...configDefaults.exclude, '**/fixtures'],
6+
},
7+
})

packages/auth-providers/auth0/web/jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)