From fcf3c6511d270e612eb9833f284fa4c8f91fd4a2 Mon Sep 17 00:00:00 2001 From: Wiktoria Van Harneveldt Date: Wed, 12 Nov 2025 19:13:42 +0100 Subject: [PATCH 1/3] feat: add build:test and test:build scripts to enhance testing workflow in package.json; update GitHub Actions to streamline build and test process --- .github/workflows/test.yml | 10 ++-------- package.json | 4 +++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c0b882c..147345b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,12 +35,6 @@ jobs: - name: Lint run: npm run lint - - name: Build - run: npm run build:ci - env: - DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} - CLIENT_ID: ${{ secrets.CLIENT_ID }} - - - name: Run tests - run: npm run test:ci + - name: Build and test + run: npm run test:build diff --git a/package.json b/package.json index 21dcc6e..ab2589f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build:ci": "npm run build:ts && npm run build:copy", "build:dev": "pnpm run build:ts && pnpm run build:copy", "build:ts": "tsup", + "build:test": "tsup --entry 'src/**/*.ts' --entry 'test/**/*.ts'", "build:copy": "node scripts/copy-assets.js", "start": "node dist/index.js", "dev": "tsx watch src/index.ts", @@ -22,7 +23,8 @@ "check:fix": "biome check --write .", "typecheck": "tsc --noEmit", "test": "pnpm run build:dev && node --test dist/**/*.test.js", - "test:ci": "node --test dist/**/*.test.js", + "test:ci": "node --test $(find dist -name '*.test.js')", + "test:build": "npm run build:test && npm run test:ci", "prepare": "husky", "pre-commit": "lint-staged", "sync-guides": "tsx scripts/sync-guides.js", From 771aa6172e756c1348f34ddd8121cd9c6e5f324d Mon Sep 17 00:00:00 2001 From: Wiktoria Van Harneveldt Date: Wed, 12 Nov 2025 19:14:59 +0100 Subject: [PATCH 2/3] refactor: convert sanity test to ts --- test/{sanity.test.mjs => sanity.test.ts} | 1 - 1 file changed, 1 deletion(-) rename test/{sanity.test.mjs => sanity.test.ts} (99%) diff --git a/test/sanity.test.mjs b/test/sanity.test.ts similarity index 99% rename from test/sanity.test.mjs rename to test/sanity.test.ts index 33a4ced..7130a62 100644 --- a/test/sanity.test.mjs +++ b/test/sanity.test.ts @@ -4,4 +4,3 @@ import test from 'node:test'; test('sanity: 1 + 1 equals 2', () => { assert.equal(1 + 1, 2); }); - From b5c177a4e58af8538f8f2e8b51bd29ac1865efb8 Mon Sep 17 00:00:00 2001 From: Wiktoria Van Harneveldt Date: Wed, 12 Nov 2025 19:15:07 +0100 Subject: [PATCH 3/3] chore: update biome.json to include test files --- biome.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.json b/biome.json index b7ae8e1..4813a99 100644 --- a/biome.json +++ b/biome.json @@ -33,6 +33,6 @@ } }, "files": { - "includes": ["*.ts", "*.js", "*.json", "src/**/*"] + "includes": ["*.ts", "*.js", "*.json", "src/**/*", "test/**/*"] } }