Skip to content

Commit

Permalink
chore: use node 20 in CI (#4370)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Oct 25, 2023
1 parent 29299f3 commit 2af2ba7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-and-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
node-version:
required: false
description: Node version for setup-node
default: 18.x
default: 20.x

runs:
using: composite
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node_version: [18]
node_version: [18, 20]
include:
- os: macos-latest
node_version: 18
node_version: 20
- os: windows-latest
node_version: 18
node_version: 20
fail-fast: false

steps:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- uses: ./.github/actions/setup-and-cache
with:
node-version: 18
node-version: 20

- name: Install
run: pnpm i
Expand All @@ -120,7 +120,7 @@ jobs:

- uses: ./.github/actions/setup-and-cache
with:
node-version: 18
node-version: 20

- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-firefox@v1
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:

- uses: ./.github/actions/setup-and-cache
with:
node-version: 18
node-version: 20

- uses: browser-actions/setup-chrome@v1
- uses: browser-actions/setup-edge@v1
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:

- uses: ./.github/actions/setup-and-cache
with:
node-version: 18
node-version: 20

- name: Install
run: sudo pnpm i --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x

- run: npx changelogithub
env:
Expand Down
8 changes: 6 additions & 2 deletions packages/vitest/src/runtime/child.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ async function init(ctx: ChildContext) {
isChildProcess: true,
}

// @ts-expect-error I know what I am doing :P
globalThis.__vitest_worker__ = state
Object.defineProperty(globalThis, '__vitest_worker__', {
value: state,
configurable: true,
writable: true,
enumerable: false,
})

if (ctx.invalidates) {
ctx.invalidates.forEach((fsPath) => {
Expand Down
7 changes: 6 additions & 1 deletion packages/vitest/src/runtime/vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ export async function run(ctx: WorkerContext) {
if (!isContext(context))
throw new TypeError(`Environment ${ctx.environment.name} doesn't provide a valid context. It should be created by "vm.createContext" method.`)

context.__vitest_worker__ = state
Object.defineProperty(context, '__vitest_worker__', {
value: state,
configurable: true,
writable: true,
enumerable: false,
})
// this is unfortunately needed for our own dependencies
// we need to find a way to not rely on this by default
// because browser doesn't provide these globals
Expand Down
8 changes: 6 additions & 2 deletions packages/vitest/src/runtime/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ async function init(ctx: WorkerContext) {
rpc,
}

// @ts-expect-error I know what I am doing :P
globalThis.__vitest_worker__ = state
Object.defineProperty(globalThis, '__vitest_worker__', {
value: state,
configurable: true,
writable: true,
enumerable: false,
})

if (ctx.invalidates) {
ctx.invalidates.forEach((fsPath) => {
Expand Down
5 changes: 0 additions & 5 deletions test/edge-runtime/test/node.test.ts

This file was deleted.

0 comments on commit 2af2ba7

Please sign in to comment.