Skip to content

Commit da98538

Browse files
authored
docs(supabase): update supabase-js testing guide (#1800)
1 parent d70d3e0 commit da98538

File tree

16 files changed

+340
-452
lines changed

16 files changed

+340
-452
lines changed

.github/workflows/ci-supabase-js.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,8 @@ jobs:
8585
- name: Install dependencies
8686
run: npm ci --legacy-peer-deps
8787

88-
- name: Type Check
89-
run: npx nx test:types supabase-js
90-
91-
- name: Run Unit Tests + Coverage
92-
run: npx nx test:coverage supabase-js
88+
- name: Type Check + Unit Tests + Coverage
89+
run: npx nx run-many --targets=test:types,test:coverage --projects=supabase-js
9390

9491
- name: Upload coverage results to Coveralls
9592
uses: coverallsapp/github-action@v2
@@ -219,7 +216,7 @@ jobs:
219216
if: ${{ matrix.deno == '2.x' }}
220217
run: |
221218
cd packages/core/supabase-js/test/deno
222-
npx nx test:edge-functions supabase-js
219+
npm run test:edge-functions
223220
cd ../../..
224221
225222
- name: Stop Supabase
@@ -344,9 +341,6 @@ jobs:
344341
echo "Verifying storage bucket exists"
345342
supabase db query "select id, name from storage.buckets where id = 'test-bucket';"
346343
347-
- name: Install Playwright browsers and dependencies
348-
run: npx playwright install --with-deps
349-
350344
- name: Verify packages in Verdaccio
351345
run: |
352346
echo "Verifying @supabase/supabase-js is available in Verdaccio..."
@@ -361,7 +355,7 @@ jobs:
361355
cd "$TEST_DIR"
362356
echo "registry=http://localhost:4873/" > .npmrc
363357
npm install --legacy-peer-deps
364-
npx playwright install
358+
npx playwright install --with-deps
365359
npm run test
366360
rm -f .npmrc
367361

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,14 @@ All pull requests must meet these requirements:
245245

246246
Each package has its own testing requirements and infrastructure. For comprehensive testing information, see:
247247

248-
- **[TESTING.md](./TESTING.md)** - Overview of testing across all packages
248+
- **[TESTING.md](./docs/TESTING.md)** - Overview of testing across all packages
249249
- **Package-specific guides** - Detailed testing instructions in each package's README:
250-
- [`supabase-js`](../packages/core/supabase-js/README.md)
251-
- [`auth-js`](../packages/core/auth-js/README.md)
252-
- [`functions-js`](../packages/core/functions-js/README.md)
253-
- [`postgrest-js`](../packages/core/postgrest-js/README.md)
254-
- [`realtime-js`](../packages/core/realtime-js/README.md)
255-
- [`storage-js`](../packages/core/storage-js/README.md)
250+
- [`supabase-js`](./packages/core/supabase-js/README.md)
251+
- [`auth-js`](./packages/core/auth-js/README.md)
252+
- [`functions-js`](./packages/core/functions-js/README.md)
253+
- [`postgrest-js`](./packages/core/postgrest-js/README.md)
254+
- [`realtime-js`](./packages/core/realtime-js/README.md)
255+
- [`storage-js`](./packages/core/storage-js/README.md)
256256

257257
### Quick Testing Commands
258258

@@ -360,7 +360,7 @@ We are committed to providing a welcoming and inspiring community for all. Pleas
360360

361361
## 📄 License
362362

363-
By contributing to Supabase JS Libraries, you agree that your contributions will be licensed under the [MIT License](../LICENSE).
363+
By contributing to Supabase JS Libraries, you agree that your contributions will be licensed under the [MIT License](./LICENSE).
364364

365365
---
366366

deno.lock

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/TESTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Each package has unique testing requirements. Please refer to the individual REA
2222

2323
### Core Packages
2424

25-
| Package | Docker Required | Test Command | Documentation |
26-
| ---------------- | ---------------------------------------- | -------------------------------- | ------------------------------------------------------------- |
27-
| **auth-js** | ✅ Yes (GoTrue + PostgreSQL) | `npx nx test:auth auth-js` | [Testing Guide](packages/core/auth-js/README.md#testing) |
28-
| **functions-js** | ✅ Yes (Deno relay via testcontainers) | `npx nx test functions-js` | [Testing Guide](packages/core/functions-js/README.md#testing) |
29-
| **postgrest-js** | ✅ Yes (PostgREST + PostgreSQL) | `npx nx test postgrest-js` | [Testing Guide](packages/core/postgrest-js/README.md#testing) |
30-
| **realtime-js** | ❌ No (uses mock WebSockets) | `npx nx test realtime-js` | [Testing Guide](packages/core/realtime-js/README.md#testing) |
31-
| **storage-js** | ✅ Yes (Storage API + PostgreSQL + Kong) | `npx nx test:storage storage-js` | [Testing Guide](packages/core/storage-js/README.md#testing) |
32-
| **supabase-js** | ❌ No (unit tests only) | `npx nx test supabase-js` | [Testing Guide](packages/core/supabase-js/README.md#testing) |
25+
| Package | Docker Required | Test Command | Documentation |
26+
| ---------------- | ---------------------------------------- | -------------------------------- | ---------------------------------------------------------------- |
27+
| **auth-js** | ✅ Yes (GoTrue + PostgreSQL) | `npx nx test:auth auth-js` | [Testing Guide](../packages/core/auth-js/README.md#testing) |
28+
| **functions-js** | ✅ Yes (Deno relay via testcontainers) | `npx nx test functions-js` | [Testing Guide](../packages/core/functions-js/README.md#testing) |
29+
| **postgrest-js** | ✅ Yes (PostgREST + PostgreSQL) | `npx nx test postgrest-js` | [Testing Guide](../packages/core/postgrest-js/README.md#testing) |
30+
| **realtime-js** | ❌ No (uses mock WebSockets) | `npx nx test realtime-js` | [Testing Guide](../packages/core/realtime-js/README.md#testing) |
31+
| **storage-js** | ✅ Yes (Storage API + PostgreSQL + Kong) | `npx nx test:storage storage-js` | [Testing Guide](../packages/core/storage-js/README.md#testing) |
32+
| **supabase-js** | ❌ No (unit tests only) | `npx nx test supabase-js` | [Testing Guide](../packages/core/supabase-js/TESTING.md) |
3333

3434
### Common Test Commands
3535

@@ -78,4 +78,4 @@ When adding new features or fixing bugs:
7878
3. Update test documentation if you change testing infrastructure
7979
4. Follow the testing patterns established in each package
8080

81-
For more details on contributing, see [CONTRIBUTING.md](./CONTRIBUTING.md).
81+
For more details on contributing, see [CONTRIBUTING.md](../CONTRIBUTING.md).

package-lock.json

Lines changed: 0 additions & 127 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"jsonwebtoken": "^9.0.0",
5858
"nx": "21.6.2",
5959
"prettier": "^3.6.2",
60-
"rimraf": "^6.0.1",
6160
"semantic-release-plugin-update-version-in-files": "^1.1.0",
6261
"ts-node": "^10.9.1",
6362
"tslib": "^2.3.0",

packages/core/auth-js/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
"directory": "packages/core/auth-js"
2727
},
2828
"scripts": {
29-
"clean": "rimraf dist docs",
3029
"coverage": "echo \"run npm test\"",
31-
"build:node18": "npm run clean && npm run build:main && npm run build:module",
32-
"build": "npm run clean && npm run build:main && npm run build:module",
30+
"build:node18": "npm run build:main && npm run build:module",
31+
"build": "npm run build:main && npm run build:module",
3332
"build:main": "tsc -p tsconfig.json",
3433
"build:module": "tsc -p tsconfig.module.json",
3534
"test:auth": "npm run test:clean && npm run test:infra && npm run test:suite && npm run test:clean",

packages/core/functions-js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
"types": "dist/module/index.d.ts",
88
"sideEffects": false,
99
"scripts": {
10-
"clean": "rimraf dist docs/v2",
1110
"format": "prettier --write \"{src,test}/**/*.ts\"",
12-
"build": "npm run clean && npm run build:main && npm run build:module",
11+
"build": "npm run build:main && npm run build:module",
1312
"build:main": "tsc -p tsconfig.json",
1413
"build:module": "tsc -p tsconfig.module.json",
1514
"docs": "typedoc src/index.ts --out docs/v2",

packages/core/postgrest-js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
"directory": "packages/core/postgrest-js"
3434
},
3535
"scripts": {
36-
"clean": "rimraf dist docs/v2",
37-
"build": "npm run clean && npm run build:cjs && npm run build:esm",
36+
"build": "npm run build:cjs && npm run build:esm",
3837
"build:cjs": "tsc -p tsconfig.json",
3938
"build:esm": "cpy wrapper.mjs dist/esm/",
4039
"build:module": "npm run build:cjs",

packages/core/realtime-js/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
"author": "Supabase",
2929
"license": "MIT",
3030
"scripts": {
31-
"clean": "rimraf dist docs/v2",
32-
"format": "prettier --write \"{src,test}/**/*.ts\"",
33-
"build": "npm run clean && npm run format && npm run build:main && npm run build:module",
31+
"build": "npm run build:main && npm run build:module",
3432
"build:main": "tsc -p tsconfig.json",
3533
"build:module": "tsc -p tsconfig.module.json",
3634
"test": "vitest run",

0 commit comments

Comments
 (0)