supabase-test 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/esm/index.js +2 -0
- package/esm/utils.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +4 -1
- package/package.json +3 -3
- package/utils.d.ts +1 -0
- package/utils.js +17 -0
package/README.md
CHANGED
|
@@ -625,6 +625,19 @@ const { conn, db, teardown } = await getConnections({
|
|
|
625
625
|
});
|
|
626
626
|
```
|
|
627
627
|
|
|
628
|
+
## Snapshot Utilities
|
|
629
|
+
|
|
630
|
+
The `supabase-test/utils` module provides utilities for sanitizing query results for snapshot testing. These helpers replace dynamic values (IDs, UUIDs, dates, hashes) with stable placeholders, making snapshots deterministic.
|
|
631
|
+
|
|
632
|
+
```ts
|
|
633
|
+
import { snapshot } from 'supabase-test/utils';
|
|
634
|
+
|
|
635
|
+
const result = await db.any('SELECT * FROM users');
|
|
636
|
+
expect(snapshot(result)).toMatchSnapshot();
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
See [`pgsql-test` Snapshot Utilities](https://www.npmjs.com/package/pgsql-test#snapshot-utilities) for the full API reference.
|
|
640
|
+
|
|
628
641
|
---
|
|
629
642
|
|
|
630
643
|
## Education and Tutorials
|
package/esm/index.js
CHANGED
package/esm/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'pgsql-test/utils';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.getConnections = void 0;
|
|
17
|
+
exports.snapshot = exports.getConnections = void 0;
|
|
18
18
|
// Re-export everything from pgsql-test
|
|
19
19
|
__exportStar(require("pgsql-test"), exports);
|
|
20
20
|
// Re-export everything from helpers.ts
|
|
@@ -22,3 +22,6 @@ __exportStar(require("./helpers"), exports);
|
|
|
22
22
|
// Export Supabase-specific getConnections with defaults baked in
|
|
23
23
|
var connect_1 = require("./connect");
|
|
24
24
|
Object.defineProperty(exports, "getConnections", { enumerable: true, get: function () { return connect_1.getConnections; } });
|
|
25
|
+
// Re-export snapshot utility
|
|
26
|
+
var pgsql_test_1 = require("pgsql-test");
|
|
27
|
+
Object.defineProperty(exports, "snapshot", { enumerable: true, get: function () { return pgsql_test_1.snapshot; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supabase-test",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"author": "Interweb <developers@interweb.io>",
|
|
5
5
|
"description": "supabase-test offers isolated, role-aware, and rollback-friendly PostgreSQL environments for integration tests with Supabase defaults baked in",
|
|
6
6
|
"main": "index.js",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@launchql/types": "^2.8.5",
|
|
56
56
|
"pg-env": "^1.1.6",
|
|
57
|
-
"pgsql-test": "^2.14.
|
|
57
|
+
"pgsql-test": "^2.14.11"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"makage": "^0.1.6"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "ff477433074d91c28be6017e858b601fa99aa568"
|
|
63
63
|
}
|
package/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'pgsql-test/utils';
|
package/utils.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("pgsql-test/utils"), exports);
|