From 18e5fb6b7e537173766f182c3f3d8e6339627f11 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Tue, 16 Apr 2024 17:07:16 +0200 Subject: [PATCH] Fix test runner --- .github/workflows/tests.yml | 3 ++- package.json | 9 ++++++--- tsconfig.esm.json | 3 +-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78206ba86..318fbb01c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,7 @@ jobs: strategy: fail-fast: false matrix: + module-system: [cjs, esm] node-version: [18, 20] arangodb-version: - arangodb/arangodb:3.11.8 @@ -36,7 +37,7 @@ jobs: - run: apk add jq - run: npm install -g npm@10 - run: npm install - - run: npm test + - run: npm run test:${{ matrix.module-system }} env: ARANGO_RELEASE: ${{ matrix.arangodb-version }} TEST_ARANGODB_URL: http://arangodb:8529 diff --git a/package.json b/package.json index 0112d5a5a..bd780e8c9 100644 --- a/package.json +++ b/package.json @@ -52,11 +52,14 @@ }, "files": [ "**/*", - "!test/**" + "!cjs/test/**", + "!esm/test/**" ], "scripts": { - "jenkins": "mocha --reporter spec --require source-map-support/register --timeout 0 build/test", - "test": "mocha --reporter spec --require source-map-support/register --timeout 10000 build/test", + "jenkins": "mocha --reporter spec --require source-map-support/register --timeout 0 build/esm/test", + "test": "npm run test:esm", + "test:cjs": "mocha --reporter spec --require source-map-support/register --timeout 10000 build/cjs/test", + "test:esm": "mocha --reporter spec --require source-map-support/register --timeout 10000 build/esm/test", "pretest": "npm run build", "build": "rm -rf build && mkdir build && npm-run-all --parallel build:*", "build:package": "cat package.json | jq 'delpaths([[\"private\"],[\"type\"],[\"scripts\"],[\"devDependencies\"],[\"babel\"],[\"browserslist\"]])' | sed 's/build\\///g' | sed -r 's/src\\/([^\"]+)\\.ts/\\1.js/g' > build/package.json", diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 824850e5d..a5fa1736f 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -5,6 +5,5 @@ "declarationMap": true, "noEmit": false, "outDir": "./build/esm/" - }, - "exclude": ["./src/test"] + } }