From 636b42993940744bca6695ca4d4720d566bcd3d3 Mon Sep 17 00:00:00 2001 From: Viktor Podzigun Date: Fri, 29 Sep 2023 20:41:55 +0200 Subject: [PATCH] Upgraded bun to 1.0.1 --- .github/workflows/ci_bun.yml | 6 +++--- test/TestErrorBoundary.test.mjs | 4 +++- test/assertComponent.test.mjs | 4 +++- test/assertComponents.test.mjs | 4 +++- test/mockComponent.test.mjs | 4 +++- test/testRenderer.test.mjs | 4 +++- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_bun.yml b/.github/workflows/ci_bun.yml index 24532fb..b8d0f36 100644 --- a/.github/workflows/ci_bun.yml +++ b/.github/workflows/ci_bun.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v1 with: - bun-version: "0.5.9" + bun-version: "1.0.1" - name: Cache Dependencies uses: actions/cache@v3 @@ -28,9 +28,9 @@ jobs: path: | ~/.bun/install/cache ~/work/react-assert/react-assert/bun.lockb - key: ${{ runner.os }}-bun-cache-v3-${{ hashFiles('package.json') }} + key: ${{ runner.os }}-bun-cache-v4-${{ hashFiles('package.json') }} restore-keys: | - ${{ runner.os }}-bun-cache-v3- + ${{ runner.os }}-bun-cache-v4- - name: Run tests run: | diff --git a/test/TestErrorBoundary.test.mjs b/test/TestErrorBoundary.test.mjs index d786a1d..1e7c4d8 100644 --- a/test/TestErrorBoundary.test.mjs +++ b/test/TestErrorBoundary.test.mjs @@ -7,10 +7,12 @@ import { assertComponents, TestErrorBoundary } from "../index.mjs"; const h = React.createElement; const { describe, it } = await (async () => { + // @ts-ignore + const module = process.isBun ? "bun:test" : "node:test"; // @ts-ignore return process.isBun // @ts-ignore ? Promise.resolve({ describe: (_, fn) => fn(), it: test }) - : import("node:test"); + : import(module); })(); describe("TestErrorBoundary.test.mjs", () => { diff --git a/test/assertComponent.test.mjs b/test/assertComponent.test.mjs index a9dca7f..789d13e 100644 --- a/test/assertComponent.test.mjs +++ b/test/assertComponent.test.mjs @@ -5,10 +5,12 @@ import { TestComp, TestComp2 } from "./testComponents.mjs"; import { strict as assert } from "node:assert"; const { describe, it } = await (async () => { + // @ts-ignore + const module = process.isBun ? "bun:test" : "node:test"; // @ts-ignore return process.isBun // @ts-ignore ? Promise.resolve({ describe: (_, fn) => fn(), it: test }) - : import("node:test"); + : import(module); })(); const h = React.createElement; diff --git a/test/assertComponents.test.mjs b/test/assertComponents.test.mjs index 0d9db67..4754bea 100644 --- a/test/assertComponents.test.mjs +++ b/test/assertComponents.test.mjs @@ -5,10 +5,12 @@ import { TestComp, TestComp2 } from "./testComponents.mjs"; import { strict as assert } from "node:assert"; const { describe, it } = await (async () => { + // @ts-ignore + const module = process.isBun ? "bun:test" : "node:test"; // @ts-ignore return process.isBun // @ts-ignore ? Promise.resolve({ describe: (_, fn) => fn(), it: test }) - : import("node:test"); + : import(module); })(); const h = React.createElement; diff --git a/test/mockComponent.test.mjs b/test/mockComponent.test.mjs index 476c563..113067f 100644 --- a/test/mockComponent.test.mjs +++ b/test/mockComponent.test.mjs @@ -4,10 +4,12 @@ import { mockComponent } from "../index.mjs"; import { TestComp } from "./testComponents.mjs"; const { describe, it } = await (async () => { + // @ts-ignore + const module = process.isBun ? "bun:test" : "node:test"; // @ts-ignore return process.isBun // @ts-ignore ? Promise.resolve({ describe: (_, fn) => fn(), it: test }) - : import("node:test"); + : import(module); })(); const h = React.createElement; diff --git a/test/testRenderer.test.mjs b/test/testRenderer.test.mjs index 66fa596..8ec21dd 100644 --- a/test/testRenderer.test.mjs +++ b/test/testRenderer.test.mjs @@ -4,10 +4,12 @@ import { TestComp, TestComp2 } from "./testComponents.mjs"; import { strict as assert } from "node:assert"; const { describe, it } = await (async () => { + // @ts-ignore + const module = process.isBun ? "bun:test" : "node:test"; // @ts-ignore return process.isBun // @ts-ignore ? Promise.resolve({ describe: (_, fn) => fn(), it: test }) - : import("node:test"); + : import(module); })(); const h = React.createElement;