test(auth-js): use node 20.x in CI (#1008)

pull/901/head
Jonathan Haines 2025-03-07 10:51:16 +11:00 committed by GitHub
parent 0c24e85798
commit 21c6b5b3f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View File

@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 18.x node-version: 20.x
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- run: yarn build - run: yarn build
- run: yarn test - run: yarn test

View File

@ -3,14 +3,9 @@ import type { Adapter } from '@auth/core/adapters'
import Credentials from '@auth/core/providers/credentials' import Credentials from '@auth/core/providers/credentials'
import { Hono } from 'hono' import { Hono } from 'hono'
import { describe, expect, it, vi } from 'vitest' import { describe, expect, it, vi } from 'vitest'
import { webcrypto } from 'node:crypto'
import type { AuthConfig } from '../src' import type { AuthConfig } from '../src'
import { authHandler, verifyAuth, initAuthConfig, reqWithEnvUrl } from '../src' import { authHandler, verifyAuth, initAuthConfig, reqWithEnvUrl } from '../src'
// @ts-expect-error - global crypto
//needed for node 18 and below but should work in node 20 and above
global.crypto = webcrypto
describe('Config', () => { describe('Config', () => {
it('Should return 500 if AUTH_SECRET is missing', async () => { it('Should return 500 if AUTH_SECRET is missing', async () => {
globalThis.process.env = { AUTH_SECRET: '' } globalThis.process.env = { AUTH_SECRET: '' }