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/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/**/*"] } } 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", 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); }); -