From b15a8036e558e060def001b5240a4ba390e47413 Mon Sep 17 00:00:00 2001 From: Derek Croote Date: Tue, 12 Dec 2023 12:43:53 -0800 Subject: [PATCH] feat: enable Node.js 20 and test in CI --- .github/workflows/main.yml | 7 +++++-- package.json | 2 +- src/processing/processing.test.ts | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7ac333..7c06222 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,10 @@ jobs: lint-build-test: runs-on: ubuntu-latest - name: Build, lint and test + strategy: + matrix: + node-version: [18, 20] + name: Build, lint and test - Node ${{ matrix.node-version }} steps: - name: Clone repo uses: actions/checkout@v4 @@ -30,7 +33,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: ${{ matrix.node-version }} cache: 'pnpm' - name: Install Dependencies run: pnpm install --frozen-lockfile diff --git a/package.json b/package.json index 8d01826..06db1db 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "keywords": [], "license": "MIT", "engines": { - "node": "^18.14.0", + "node": "^18.14.0 || ^20.10.0", "pnpm": "^8.8.0" }, "files": [ diff --git a/src/processing/processing.test.ts b/src/processing/processing.test.ts index 110c2ae..cece693 100644 --- a/src/processing/processing.test.ts +++ b/src/processing/processing.test.ts @@ -58,7 +58,7 @@ describe(preProcessEndpointParametersV1.name, () => { const throwingFunc = async () => preProcessEndpointParametersV1(preProcessingSpecifications, parameters); - await expect(throwingFunc).rejects.toEqual(new Error('SyntaxError: Unexpected identifier')); + await expect(throwingFunc).rejects.toThrow('SyntaxError: Unexpected identifier'); }); it('demonstrates access to endpointParameters, but reserved parameters are inaccessible', async () => { @@ -192,7 +192,7 @@ describe(postProcessResponseV1.name, () => { const throwingFunc = async () => postProcessResponseV1({ price: 1000 }, postProcessingSpecifications, parameters); - await expect(throwingFunc).rejects.toEqual(new Error('SyntaxError: Unexpected identifier')); + await expect(throwingFunc).rejects.toThrow('SyntaxError: Unexpected identifier'); }); }); @@ -298,7 +298,7 @@ describe(preProcessEndpointParametersV2.name, () => { const throwingFunc = async () => preProcessEndpointParametersV2(preProcessingSpecificationV2, parameters); - await expect(throwingFunc).rejects.toEqual(new Error('SyntaxError: Unexpected identifier')); + await expect(throwingFunc).rejects.toThrow('SyntaxError: Unexpected identifier'); }); it('reserved parameters are inaccessible', async () => { @@ -454,7 +454,7 @@ describe(postProcessResponseV2.name, () => { const throwingFunc = async () => postProcessResponseV2({ price: 1000 }, postProcessingSpecificationV2, parameters); - await expect(throwingFunc).rejects.toEqual(new Error('SyntaxError: Unexpected identifier')); + await expect(throwingFunc).rejects.toThrow('SyntaxError: Unexpected identifier'); }); });