Skip to content

Commit

Permalink
Added multi-backend testing to CI
Browse files Browse the repository at this point in the history
Added test:common NPM script
Renamed some test setup scripts
  • Loading branch information
james-pre committed Oct 28, 2024
1 parent 0ce5424 commit 5b42f2f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ jobs:
- name: Build
run: npm run build

- name: Unit tests
run: npm test
- name: Unit tests (common)
run: npm run test:common

- name: Unit tests (InMemory)
run: npx zenfs-test tests/setup/memory.ts

- name: Unit tests (Overlay+Fetch)
run: npx zenfs-test tests/setup/cow+fetch.ts
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint src tests",
"test:common": "tsx --test --experimental-test-coverage 'tests/**/!(fs)/*.test.ts' 'tests/*.test.ts'",
"test": "tsx --test --experimental-test-coverage",
"build": "tsc -p tsconfig.json",
"build:docs": "typedoc",
Expand Down
2 changes: 1 addition & 1 deletion tests/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function createTSWorker(source: string): Worker {
return new Worker(`import('tsx/esm/api').then(tsx => {tsx.register();import('${source}');});`, { eval: true });
}

const setupPath = resolve(process.env.SETUP || join(import.meta.dirname, 'setup/InMemory.ts'));
const setupPath = resolve(process.env.SETUP || join(import.meta.dirname, 'setup/memory.ts'));

await import(setupPath).catch(error => {
console.log('Failed to import test setup:');
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 5b42f2f

Please sign in to comment.