Skip to content

Commit 6d4d12f

Browse files
authored
chore: Use bun:test instead of vitest (#43)
1 parent e6469de commit 6d4d12f

File tree

11 files changed

+42
-205
lines changed

11 files changed

+42
-205
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: ./.github/actions/setup
1717
- run: bun run build
1818
- run: bun check
19-
- run: bun run test
19+
- run: bun test
2020
- run: node bin/publish-extension.cjs --help
2121
e2e-tests:
2222
name: E2E Tests

bun.lock

Lines changed: 10 additions & 173 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656
"build:lib": "tsup src/index.ts --dts --format cjs,esm --sourcemap",
5757
"build:cli": "tsup --format cjs,esm --entry.cli src/cli.ts",
5858
"build:test-extension": "node scripts/build-test-extension.js",
59-
"test": "vitest",
60-
"test:coverage": "vitest --coverage",
6159
"dev:all": "./scripts/dev.sh all",
6260
"dev:chrome": "./scripts/dev.sh chrome",
6361
"dev:firefox": "./scripts/dev.sh firefox",
@@ -79,9 +77,9 @@
7977
},
8078
"devDependencies": {
8179
"@aklinker1/check": "^2.1.2",
80+
"@types/bun": "^1.3.1",
8281
"@types/jsonwebtoken": "^8.5.9",
8382
"@types/node": "^18.19.123",
84-
"@vitest/coverage-v8": "^1.6.1",
8583
"archiver": "^5.3.2",
8684
"jsonwebtoken": "^8.5.1",
8785
"lint-staged": "^15.5.2",
@@ -91,8 +89,7 @@
9189
"rimraf": "^4.4.1",
9290
"simple-git-hooks": "^2.13.1",
9391
"tsup": "^8.5.0",
94-
"typescript": "^5.9.3",
95-
"vitest": "^1.6.1"
92+
"typescript": "^5.9.3"
9693
},
9794
"simple-git-hooks": {
9895
"pre-commit": "bun lint-staged"

src/chrome/chrome-web-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CwsApi } from './chrome-api';
2-
import { Store } from '../utils/store';
2+
import type { Store } from '../utils/store';
33
import { z } from 'zod/v4';
44
import { ensureZipExists } from '../utils/fs';
55

src/config.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, beforeEach } from 'vitest';
1+
import { describe, it, expect, beforeEach } from 'bun:test';
22
import {
33
InlineConfig,
44
InternalConfig,
@@ -161,11 +161,11 @@ describe('resolveConfig', () => {
161161
skipSubmitReview: false,
162162
reviewExemption: false,
163163
deployPercentage: undefined,
164-
publishTarget: 'default',
164+
publishTarget: 'default' as const,
165165
},
166166
firefox: {
167167
...config.firefox,
168-
channel: 'listed',
168+
channel: 'listed' as const,
169169
},
170170
edge: {
171171
...config.edge,

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { z } from 'zod/v4';
22
import { ChromeWebStoreOptions } from './chrome';
33
import { EdgeAddonStoreOptions } from './edge';
44
import { FirefoxAddonStoreOptions } from './firefox';
5-
import { DeepPartial } from './utils/types';
5+
import type { DeepPartial } from './utils/types';
66

77
/**
88
* Given inline config, read environment variables and apply defaults. Throws an error if any config

src/edge/edge-addon-store.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { DraftOperation, EdgeApi, EdgeTokenDetails } from './edge-api';
1+
import {
2+
type DraftOperation,
3+
EdgeApi,
4+
type EdgeTokenDetails,
5+
} from './edge-api';
26
import { sleep } from '../utils/sleep';
37
import { withTimeout } from '../utils/withTimeout';
4-
import { Store } from '../utils/store';
8+
import type { Store } from '../utils/store';
59
import { z } from 'zod/v4';
610
import { ensureZipExists } from '../utils/fs';
711

src/firefox/firefox-addon-store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { AddonsApi, UploadDetails } from './firefox-api';
1+
import { AddonsApi, type UploadDetails } from './firefox-api';
22
import { sleep } from '../utils/sleep';
33
import { withTimeout } from '../utils/withTimeout';
44
import { plural } from '../utils/plural';
5-
import { Store } from '../utils/store';
5+
import type { Store } from '../utils/store';
66
import { z } from 'zod/v4';
77
import { ensureZipExists } from '../utils/fs';
88

src/submit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ChromeWebStore } from './chrome';
33
import { InlineConfig, resolveConfig, validateConfig } from './config';
44
import { EdgeAddonStore } from './edge';
55
import { FirefoxAddonStore } from './firefox';
6-
import { Store, SubmitResult } from './utils/store';
6+
import type { Store, SubmitResult } from './utils/store';
77
import { consola } from 'consola';
88

99
export async function submit(config: InlineConfig): Promise<SubmitResults> {

tsconfig.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
{
22
"compilerOptions": {
3+
// Environment setup & latest features
4+
"lib": ["ESNext"],
35
"target": "ESNext",
4-
"module": "ESNext",
5-
"lib": ["ESNext", "DOM"],
6-
"moduleResolution": "node",
7-
"types": ["node"],
8-
"esModuleInterop": true,
9-
"resolveJsonModule": true,
10-
"forceConsistentCasingInFileNames": true,
6+
"module": "Preserve",
7+
"moduleDetection": "force",
8+
9+
// Bundler mode
10+
"moduleResolution": "bundler",
11+
"allowImportingTsExtensions": true,
12+
"verbatimModuleSyntax": true,
13+
"noEmit": true,
14+
15+
// Best practices
1116
"strict": true,
1217
"skipLibCheck": true,
13-
"noEmit": true
18+
"noFallthroughCasesInSwitch": true,
19+
"noUncheckedIndexedAccess": true,
20+
"noImplicitOverride": true
1421
},
1522
"exclude": ["dist"]
1623
}

0 commit comments

Comments
 (0)