@fireproof/core-test 0.24.11 → 0.24.12
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fireproof, getLedgerSvc } from "@fireproof/core-base";
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
describe("Ledger Service", () => {
|
|
4
|
+
it("get LedgerSvc", async () => {
|
|
5
|
+
const svc1 = getLedgerSvc();
|
|
6
|
+
const svc2 = getLedgerSvc();
|
|
7
|
+
expect(svc1).toBe(svc2);
|
|
8
|
+
});
|
|
9
|
+
it("dispatch onCreate and onClose events", async () => {
|
|
10
|
+
const svc = getLedgerSvc();
|
|
11
|
+
const fn1 = vi.fn();
|
|
12
|
+
const fn2 = vi.fn();
|
|
13
|
+
svc.onCreate(fn1);
|
|
14
|
+
svc.onClose(fn2);
|
|
15
|
+
const fp1 = [fireproof("db1"), fireproof("db1")];
|
|
16
|
+
const fp2 = [fireproof("db2"), fireproof("db2")];
|
|
17
|
+
await Promise.all(fp1.map((db) => db.close()));
|
|
18
|
+
await Promise.all(fp2.map((db) => db.close()));
|
|
19
|
+
expect(fn1).toHaveBeenCalledTimes(2);
|
|
20
|
+
expect(fn1.mock.calls[0][0].refId()).toEqual(fp1[0].ledger.refId());
|
|
21
|
+
expect(fn1.mock.calls[1][0].refId()).toEqual(fp2[0].ledger.refId());
|
|
22
|
+
expect(fn2).toHaveBeenCalledTimes(2);
|
|
23
|
+
expect(fn2.mock.calls[0][0].refId()).toEqual(fp1[1].ledger.refId());
|
|
24
|
+
expect(fn2.mock.calls[1][0].refId()).toEqual(fp2[1].ledger.refId());
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=ledger-svc.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-svc.test.js","sourceRoot":"","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AAC,CAAC,CAAC;QAE/C,MAAM,CAAC,GAAG,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACpE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAEpE,MAAM,CAAC,GAAG,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACpE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAAA,CACrE,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fireproof/core-test",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.12",
|
|
4
4
|
"description": "Live ledger for the web.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -39,28 +39,28 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@adviser/cement": "~0.5.22",
|
|
42
|
-
"@fireproof/core": "0.24.
|
|
43
|
-
"@fireproof/core-base": "0.24.
|
|
44
|
-
"@fireproof/core-blockstore": "0.24.
|
|
45
|
-
"@fireproof/core-device-id": "0.24.
|
|
46
|
-
"@fireproof/core-gateways-base": "0.24.
|
|
47
|
-
"@fireproof/core-gateways-cloud": "0.24.
|
|
48
|
-
"@fireproof/core-gateways-file": "0.24.
|
|
49
|
-
"@fireproof/core-gateways-indexeddb": "0.24.
|
|
50
|
-
"@fireproof/core-gateways-memory": "0.24.
|
|
51
|
-
"@fireproof/core-keybag": "0.24.
|
|
52
|
-
"@fireproof/core-protocols-cloud": "0.24.
|
|
53
|
-
"@fireproof/core-protocols-dashboard": "0.24.
|
|
54
|
-
"@fireproof/core-runtime": "0.24.
|
|
55
|
-
"@fireproof/core-svc-api": "0.24.
|
|
56
|
-
"@fireproof/core-svc-host": "0.24.
|
|
57
|
-
"@fireproof/core-svc-protocol": "0.24.
|
|
58
|
-
"@fireproof/core-types-base": "0.24.
|
|
59
|
-
"@fireproof/core-types-blockstore": "0.24.
|
|
60
|
-
"@fireproof/core-types-protocols-cloud": "0.24.
|
|
61
|
-
"@fireproof/core-types-protocols-dashboard": "0.24.
|
|
62
|
-
"@fireproof/core-types-runtime": "0.24.
|
|
63
|
-
"@fireproof/vendor": "0.24.
|
|
42
|
+
"@fireproof/core": "0.24.12",
|
|
43
|
+
"@fireproof/core-base": "0.24.12",
|
|
44
|
+
"@fireproof/core-blockstore": "0.24.12",
|
|
45
|
+
"@fireproof/core-device-id": "0.24.12",
|
|
46
|
+
"@fireproof/core-gateways-base": "0.24.12",
|
|
47
|
+
"@fireproof/core-gateways-cloud": "0.24.12",
|
|
48
|
+
"@fireproof/core-gateways-file": "0.24.12",
|
|
49
|
+
"@fireproof/core-gateways-indexeddb": "0.24.12",
|
|
50
|
+
"@fireproof/core-gateways-memory": "0.24.12",
|
|
51
|
+
"@fireproof/core-keybag": "0.24.12",
|
|
52
|
+
"@fireproof/core-protocols-cloud": "0.24.12",
|
|
53
|
+
"@fireproof/core-protocols-dashboard": "0.24.12",
|
|
54
|
+
"@fireproof/core-runtime": "0.24.12",
|
|
55
|
+
"@fireproof/core-svc-api": "0.24.12",
|
|
56
|
+
"@fireproof/core-svc-host": "0.24.12",
|
|
57
|
+
"@fireproof/core-svc-protocol": "0.24.12",
|
|
58
|
+
"@fireproof/core-types-base": "0.24.12",
|
|
59
|
+
"@fireproof/core-types-blockstore": "0.24.12",
|
|
60
|
+
"@fireproof/core-types-protocols-cloud": "0.24.12",
|
|
61
|
+
"@fireproof/core-types-protocols-dashboard": "0.24.12",
|
|
62
|
+
"@fireproof/core-types-runtime": "0.24.12",
|
|
63
|
+
"@fireproof/vendor": "0.24.12",
|
|
64
64
|
"@ipld/car": "~5.4.2",
|
|
65
65
|
"@ipld/dag-cbor": "~9.2.5",
|
|
66
66
|
"@ipld/dag-json": "~10.2.6",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"cborg": "~4.5.8",
|
|
69
69
|
"charwise": "~3.0.1",
|
|
70
70
|
"jose": "~6.1.3",
|
|
71
|
-
"use-fireproof": "0.24.
|
|
71
|
+
"use-fireproof": "0.24.12",
|
|
72
72
|
"uuidv7": "~1.1.0",
|
|
73
73
|
"zod": "~4.3.6"
|
|
74
74
|
}
|