@daiso-tech/core 0.38.0 → 0.40.0
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 +5 -1
- package/dist/async/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +1 -1
- package/dist/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +2 -2
- package/dist/async/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +1 -1
- package/dist/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +2 -2
- package/dist/async/middlewares/bulkhead/bulkhead.middleware.d.ts +2 -2
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.js +2 -2
- package/dist/async/middlewares/hedging/sequential-hedging.middleware.js.map +1 -1
- package/dist/async/middlewares/retry/retry.middleware.js +2 -2
- package/dist/async/middlewares/retry/retry.middleware.js.map +1 -1
- package/dist/async/middlewares/retry/retry.types.d.ts +1 -1
- package/dist/cache/contracts/cache-adapter.contract.d.ts +9 -9
- package/dist/cache/contracts/cache.contract.d.ts +7 -7
- package/dist/cache/contracts/cache.errors.d.ts +3 -26
- package/dist/cache/contracts/cache.errors.js +0 -47
- package/dist/cache/contracts/cache.errors.js.map +1 -1
- package/dist/cache/contracts/database-cache-adapter.contract.d.ts +10 -10
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.d.ts +6 -5
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js +17 -13
- package/dist/cache/implementations/adapters/kysely-cache-adapter/kysely-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +15 -3
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +25 -9
- package/dist/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +9 -9
- package/dist/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +1 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js +2 -1
- package/dist/cache/implementations/adapters/redis-cache-adapter/utilities.js.map +1 -1
- package/dist/cache/implementations/derivables/cache/cache.d.ts +2 -2
- package/dist/cache/implementations/derivables/cache/cache.js +1 -1
- package/dist/cache/implementations/derivables/cache/cache.js.map +1 -1
- package/dist/collection/contracts/async-collection.contract.d.ts +0 -1
- package/dist/collection/contracts/async-collection.contract.js +3 -1
- package/dist/collection/contracts/async-collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.contract.d.ts +0 -1
- package/dist/collection/contracts/collection.contract.js +3 -1
- package/dist/collection/contracts/collection.contract.js.map +1 -1
- package/dist/collection/contracts/collection.errors.d.ts +1 -26
- package/dist/collection/contracts/collection.errors.js +0 -55
- package/dist/collection/contracts/collection.errors.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-split-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js +1 -1
- package/dist/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.js.map +1 -1
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js +9 -6
- package/dist/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/split-iterable.js +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/split-iterable.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/zip-iterable.js +1 -1
- package/dist/collection/implementations/iterable-collection/_shared/zip-iterable.js.map +1 -1
- package/dist/collection/implementations/iterable-collection/iterable-collection.js +9 -6
- package/dist/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/collection/implementations/list-collection/list-collection.js +12 -9
- package/dist/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/event-bus/contracts/_module-exports.d.ts +0 -1
- package/dist/event-bus/contracts/_module-exports.js +0 -1
- package/dist/event-bus/contracts/_module-exports.js.map +1 -1
- package/dist/event-bus/contracts/event-bus-adapter.contract.d.ts +3 -3
- package/dist/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +3 -3
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +2 -2
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +3 -2
- package/dist/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.d.ts +2 -1
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js +26 -26
- package/dist/event-bus/implementations/derivables/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.d.ts +11 -4
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js +17 -12
- package/dist/event-bus/implementations/derivables/event-bus/listener-store.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js +17 -20
- package/dist/event-bus/implementations/test-utilities/event-bus-adapter.test-suite.js.map +1 -1
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js +159 -752
- package/dist/event-bus/implementations/test-utilities/event-bus.test-suite.js.map +1 -1
- package/dist/lock/contracts/database-lock-adapter.contract.d.ts +56 -16
- package/dist/lock/contracts/lock-adapter.contract.d.ts +32 -9
- package/dist/lock/contracts/lock-adapter.contract.js +10 -1
- package/dist/lock/contracts/lock-adapter.contract.js.map +1 -1
- package/dist/lock/contracts/lock.contract.d.ts +30 -25
- package/dist/lock/contracts/lock.errors.d.ts +11 -28
- package/dist/lock/contracts/lock.errors.js +10 -74
- package/dist/lock/contracts/lock.errors.js.map +1 -1
- package/dist/lock/contracts/lock.events.d.ts +15 -3
- package/dist/lock/contracts/lock.events.js +2 -1
- package/dist/lock/contracts/lock.events.js.map +1 -1
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.d.ts +40 -10
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js +135 -37
- package/dist/lock/implementations/adapters/kysely-lock-adapter/kysely-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.d.ts +20 -7
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js +59 -35
- package/dist/lock/implementations/adapters/memory-lock-adapter/memory-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.d.ts +23 -12
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js +152 -87
- package/dist/lock/implementations/adapters/mongodb-lock-adapter/mongodb-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.d.ts +5 -5
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js +3 -2
- package/dist/lock/implementations/adapters/no-op-lock-adapter/no-op-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.d.ts +6 -6
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js +46 -24
- package/dist/lock/implementations/adapters/redis-lock-adapter/redis-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.d.ts +4 -4
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js +45 -12
- package/dist/lock/implementations/derivables/lock-provider/database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js +7 -5
- package/dist/lock/implementations/derivables/lock-provider/is-database-lock-adapter.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.d.ts +3 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js +2 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-provider.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.d.ts +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js +4 -3
- package/dist/lock/implementations/derivables/lock-provider/lock-serde-transformer.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock-state.d.ts +8 -11
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js +9 -26
- package/dist/lock/implementations/derivables/lock-provider/lock-state.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider/lock.d.ts +14 -16
- package/dist/lock/implementations/derivables/lock-provider/lock.js +106 -63
- package/dist/lock/implementations/derivables/lock-provider/lock.js.map +1 -1
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.d.ts +2 -2
- package/dist/lock/implementations/derivables/lock-provider-factory/lock-provider-factory.js.map +1 -1
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js +184 -166
- package/dist/lock/implementations/test-utilities/database-lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js +240 -41
- package/dist/lock/implementations/test-utilities/lock-adapter.test-suite.js.map +1 -1
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js +2704 -1514
- package/dist/lock/implementations/test-utilities/lock-provider.test-suite.js.map +1 -1
- package/dist/serde/implementations/derivables/serde.d.ts +22 -22
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js +2 -1
- package/dist/utilities/classes/kysely-table-name-transformer-plugin/kysely-table-name-transformer-plugin.js.map +1 -1
- package/dist/utilities/classes/namespace/namespace.d.ts +3 -3
- package/dist/utilities/classes/namespace/namespace.js +2 -2
- package/dist/utilities/classes/namespace/namespace.js.map +1 -1
- package/dist/utilities/classes/time-span/time-span.d.ts +10 -2
- package/dist/utilities/classes/time-span/time-span.js +10 -2
- package/dist/utilities/classes/time-span/time-span.js.map +1 -1
- package/dist/utilities/contracts/deinitizable.contract.d.ts +1 -1
- package/dist/utilities/contracts/initizable.contract.d.ts +1 -1
- package/dist/utilities/contracts/prunable.contract.d.ts +1 -1
- package/dist/utilities/errors.d.ts +8 -0
- package/dist/utilities/errors.js +11 -0
- package/dist/utilities/errors.js.map +1 -1
- package/dist/utilities/functions/_module.d.ts +1 -0
- package/dist/utilities/functions/_module.js +1 -0
- package/dist/utilities/functions/_module.js.map +1 -1
- package/dist/utilities/functions/is-class.d.ts +4 -0
- package/dist/utilities/functions/is-class.js +4 -0
- package/dist/utilities/functions/is-class.js.map +1 -1
- package/dist/utilities/functions/is-positive-nbr.d.ts +8 -0
- package/dist/utilities/functions/is-positive-nbr.js +19 -0
- package/dist/utilities/functions/is-positive-nbr.js.map +1 -0
- package/package.json +1 -1
- package/dist/event-bus/contracts/event-bus.errors.d.ts +0 -40
- package/dist/event-bus/contracts/event-bus.errors.js +0 -62
- package/dist/event-bus/contracts/event-bus.errors.js.map +0 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module Lock
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {} from "vitest";
|
|
5
5
|
import {} from "../../../lock/contracts/_module-exports.js";
|
|
6
|
-
import {} from "../../../utilities/_module-exports.js";
|
|
7
6
|
import { TimeSpan } from "../../../utilities/_module-exports.js";
|
|
8
7
|
/**
|
|
9
8
|
* The `databaseLockAdapterTestSuite` function simplifies the process of testing your custom implementation of {@link IDatabaseLockAdapter | `IDatabaseLockAdapter`} with `vitest`.
|
|
@@ -51,201 +50,220 @@ export function databaseLockAdapterTestSuite(settings) {
|
|
|
51
50
|
beforeEach(async () => {
|
|
52
51
|
adapter = await createAdapter();
|
|
53
52
|
});
|
|
54
|
-
const ttl = TimeSpan.fromMilliseconds(50);
|
|
55
53
|
describe("method: insert", () => {
|
|
56
|
-
test("Should insert
|
|
57
|
-
const key = "
|
|
58
|
-
const owner = "
|
|
59
|
-
const expiration =
|
|
54
|
+
test("Should insert when key doesnt exists", async () => {
|
|
55
|
+
const key = "key";
|
|
56
|
+
const owner = "a";
|
|
57
|
+
const expiration = new Date("2025");
|
|
60
58
|
await adapter.insert(key, owner, expiration);
|
|
61
|
-
|
|
62
|
-
expect(result).toEqual({
|
|
59
|
+
expect(await adapter.find(key)).toEqual({
|
|
63
60
|
owner,
|
|
64
61
|
expiration,
|
|
65
62
|
});
|
|
66
63
|
});
|
|
67
|
-
test("Should
|
|
68
|
-
const key = "
|
|
69
|
-
const owner = "
|
|
70
|
-
const expiration =
|
|
64
|
+
test("Should throw error when key already exsists", async () => {
|
|
65
|
+
const key = "key";
|
|
66
|
+
const owner = "a";
|
|
67
|
+
const expiration = new Date("2025");
|
|
71
68
|
await adapter.insert(key, owner, expiration);
|
|
72
|
-
const
|
|
73
|
-
expect(
|
|
74
|
-
owner,
|
|
75
|
-
expiration,
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
test("Should throw error when lock already existing", async () => {
|
|
79
|
-
const key = "a";
|
|
80
|
-
const owner = "b";
|
|
81
|
-
const expiration = null;
|
|
82
|
-
await adapter.insert(key, owner, expiration);
|
|
83
|
-
const result = adapter.insert(key, owner, expiration);
|
|
84
|
-
await expect(result).rejects.toBeDefined();
|
|
69
|
+
const promise = adapter.insert(key, owner, expiration);
|
|
70
|
+
await expect(promise).rejects.toBeDefined();
|
|
85
71
|
});
|
|
86
72
|
});
|
|
87
|
-
describe("method:
|
|
88
|
-
test("Should return
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const expiration =
|
|
92
|
-
await adapter.
|
|
93
|
-
const owner2 = "c";
|
|
94
|
-
const result = await adapter.update(key, owner2, expiration);
|
|
73
|
+
describe("method: updateIfExpired", () => {
|
|
74
|
+
test("Should return 0 when key doesnt exists", async () => {
|
|
75
|
+
const noneExistingKey = "key";
|
|
76
|
+
const noneExistingOwner = "b";
|
|
77
|
+
const expiration = TimeSpan.fromMinutes(4).toStartDate();
|
|
78
|
+
const result = await adapter.updateIfExpired(noneExistingKey, noneExistingOwner, expiration);
|
|
95
79
|
expect(result).toBe(0);
|
|
96
80
|
});
|
|
97
|
-
test("Should
|
|
98
|
-
const key = "
|
|
99
|
-
const
|
|
100
|
-
const
|
|
101
|
-
await adapter.insert(key,
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
const result = await adapter.
|
|
105
|
-
expect(result).
|
|
106
|
-
|
|
107
|
-
|
|
81
|
+
test("Should number greater than 0 when key is expired", async () => {
|
|
82
|
+
const key = "key";
|
|
83
|
+
const ownerA = "a";
|
|
84
|
+
const expirationA = TimeSpan.fromMinutes(2).toStartDate();
|
|
85
|
+
await adapter.insert(key, ownerA, expirationA);
|
|
86
|
+
const ownerB = "b";
|
|
87
|
+
const expirationB = TimeSpan.fromMinutes(2).toEndDate();
|
|
88
|
+
const result = await adapter.updateIfExpired(key, ownerB, expirationB);
|
|
89
|
+
expect(result).toBeGreaterThan(0);
|
|
90
|
+
});
|
|
91
|
+
test("Should not update expiration when key is unexpired", async () => {
|
|
92
|
+
const key = "key";
|
|
93
|
+
const ownerA = "a";
|
|
94
|
+
const expirationA = TimeSpan.fromMinutes(2).toEndDate();
|
|
95
|
+
await adapter.insert(key, ownerA, expirationA);
|
|
96
|
+
const ownerB = "b";
|
|
97
|
+
const expirationB = TimeSpan.fromMinutes(3).toEndDate();
|
|
98
|
+
await adapter.updateIfExpired(key, ownerB, expirationB);
|
|
99
|
+
const lockData = await adapter.find(key);
|
|
100
|
+
expect(lockData).toEqual({
|
|
101
|
+
owner: ownerA,
|
|
102
|
+
expiration: expirationA,
|
|
108
103
|
});
|
|
109
104
|
});
|
|
110
|
-
test("Should return
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
const expiration2 = ttl.addMilliseconds(25).toEndDate();
|
|
119
|
-
const result = await adapter.update(key, owner2, expiration2);
|
|
105
|
+
test("Should return 0 when key is unexpired", async () => {
|
|
106
|
+
const key = "key";
|
|
107
|
+
const ownerA = "a";
|
|
108
|
+
const expirationA = TimeSpan.fromMinutes(2).toEndDate();
|
|
109
|
+
await adapter.insert(key, ownerA, expirationA);
|
|
110
|
+
const ownerB = "b";
|
|
111
|
+
const expirationB = TimeSpan.fromMinutes(3).toEndDate();
|
|
112
|
+
const result = await adapter.updateIfExpired(key, ownerB, expirationB);
|
|
120
113
|
expect(result).toBe(0);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
expect(result).toEqual({
|
|
135
|
-
owner: owner1,
|
|
136
|
-
expiration: expiration1,
|
|
137
|
-
});
|
|
138
|
-
vi.useRealTimers();
|
|
139
|
-
});
|
|
140
|
-
test("Should return true when lock has expired", async () => {
|
|
141
|
-
vi.useFakeTimers();
|
|
142
|
-
const key = "a";
|
|
143
|
-
const owner1 = "b";
|
|
144
|
-
const expiration1 = ttl.toEndDate();
|
|
145
|
-
await adapter.insert(key, owner1, expiration1);
|
|
146
|
-
vi.advanceTimersByTime(ttl.addMilliseconds(1).toMilliseconds());
|
|
147
|
-
const owner2 = "c";
|
|
148
|
-
const expiration2 = ttl.addMilliseconds(25).toEndDate();
|
|
149
|
-
const result = await adapter.update(key, owner2, expiration2);
|
|
150
|
-
expect(result).toBe(1);
|
|
151
|
-
vi.useRealTimers();
|
|
152
|
-
});
|
|
153
|
-
test("Should update when lock has expired", async () => {
|
|
154
|
-
vi.useFakeTimers();
|
|
155
|
-
const key = "a";
|
|
156
|
-
const owner1 = "b";
|
|
157
|
-
const expiration1 = ttl.toEndDate();
|
|
158
|
-
await adapter.insert(key, owner1, expiration1);
|
|
159
|
-
vi.advanceTimersByTime(ttl.addMilliseconds(1).toMilliseconds());
|
|
160
|
-
const owner2 = "c";
|
|
161
|
-
const expiration2 = ttl.addMilliseconds(25).toEndDate();
|
|
162
|
-
await adapter.update(key, owner2, expiration2);
|
|
163
|
-
const result = await adapter.find(key);
|
|
164
|
-
expect(result).toEqual({
|
|
165
|
-
owner: owner2,
|
|
166
|
-
expiration: expiration2,
|
|
114
|
+
});
|
|
115
|
+
test("Should not update expiration when key is uenxpireable", async () => {
|
|
116
|
+
const key = "key";
|
|
117
|
+
const ownerA = "a";
|
|
118
|
+
const expirationA = null;
|
|
119
|
+
await adapter.insert(key, ownerA, expirationA);
|
|
120
|
+
const ownerB = "b";
|
|
121
|
+
const expirationB = TimeSpan.fromMinutes(3).toEndDate();
|
|
122
|
+
await adapter.updateIfExpired(key, ownerB, expirationB);
|
|
123
|
+
const lockData = await adapter.find(key);
|
|
124
|
+
expect(lockData).toEqual({
|
|
125
|
+
owner: ownerA,
|
|
126
|
+
expiration: expirationA,
|
|
167
127
|
});
|
|
168
|
-
|
|
128
|
+
});
|
|
129
|
+
test("Should return 0 when key is uenxpireable", async () => {
|
|
130
|
+
const key = "key";
|
|
131
|
+
const ownerA = "a";
|
|
132
|
+
const expirationA = null;
|
|
133
|
+
await adapter.insert(key, ownerA, expirationA);
|
|
134
|
+
const ownerB = "b";
|
|
135
|
+
const expirationB = TimeSpan.fromMinutes(3).toEndDate();
|
|
136
|
+
const result = await adapter.updateIfExpired(key, ownerB, expirationB);
|
|
137
|
+
expect(result).toBe(0);
|
|
169
138
|
});
|
|
170
139
|
});
|
|
171
140
|
describe("method: remove", () => {
|
|
172
|
-
test("Should
|
|
173
|
-
const key = "
|
|
174
|
-
const
|
|
175
|
-
const expiration =
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
await adapter.remove(key
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
141
|
+
test("Should remove key", async () => {
|
|
142
|
+
const key = "key";
|
|
143
|
+
const owner = "a";
|
|
144
|
+
const expiration = new Date("2025");
|
|
145
|
+
expiration.setMinutes(expiration.getMinutes() + 2);
|
|
146
|
+
await adapter.insert(key, owner, expiration);
|
|
147
|
+
await adapter.remove(key);
|
|
148
|
+
expect(await adapter.find(key)).toBeNull();
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
describe("method: removeIfOwner", () => {
|
|
152
|
+
test("Should return null when key deosnt exists", async () => {
|
|
153
|
+
const noneExsistingKey = "key";
|
|
154
|
+
const noneExsistingOwner = "b";
|
|
155
|
+
const lockExpirationData = await adapter.removeIfOwner(noneExsistingKey, noneExsistingOwner);
|
|
156
|
+
expect(lockExpirationData).toBeNull();
|
|
157
|
+
});
|
|
158
|
+
test("Should return ILockData when key exists and owner match", async () => {
|
|
159
|
+
const key = "key";
|
|
160
|
+
const owner = "a";
|
|
161
|
+
const expiration = new Date("2025");
|
|
162
|
+
await adapter.insert(key, owner, expiration);
|
|
163
|
+
const lockExpirationData = await adapter.removeIfOwner(key, owner);
|
|
164
|
+
expect(lockExpirationData).toEqual({
|
|
182
165
|
expiration,
|
|
166
|
+
owner,
|
|
183
167
|
});
|
|
184
168
|
});
|
|
185
|
-
test("Should remove
|
|
186
|
-
const key = "
|
|
187
|
-
const owner = "
|
|
188
|
-
const expiration =
|
|
169
|
+
test("Should remove when key exists and owner match", async () => {
|
|
170
|
+
const key = "key";
|
|
171
|
+
const owner = "a";
|
|
172
|
+
const expiration = new Date("2025");
|
|
189
173
|
await adapter.insert(key, owner, expiration);
|
|
190
|
-
await adapter.
|
|
191
|
-
|
|
192
|
-
expect(result).toBeNull();
|
|
174
|
+
await adapter.removeIfOwner(key, owner);
|
|
175
|
+
expect(await adapter.find(key)).toBeNull();
|
|
193
176
|
});
|
|
194
|
-
test("Should
|
|
195
|
-
const key = "
|
|
196
|
-
const owner = "
|
|
197
|
-
const expiration =
|
|
177
|
+
test("Should return null when key exists and owner doesnt match", async () => {
|
|
178
|
+
const key = "key";
|
|
179
|
+
const owner = "a";
|
|
180
|
+
const expiration = new Date("2025");
|
|
198
181
|
await adapter.insert(key, owner, expiration);
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
expect(
|
|
182
|
+
const noneExsistingOwner = "b";
|
|
183
|
+
const lockExpirationData = await adapter.removeIfOwner(key, noneExsistingOwner);
|
|
184
|
+
expect(lockExpirationData).toBeNull();
|
|
185
|
+
});
|
|
186
|
+
test("Should not remove when key exists and owner doesnt match", async () => {
|
|
187
|
+
const key = "key";
|
|
188
|
+
const owner = "a";
|
|
189
|
+
const expiration = new Date("2025");
|
|
190
|
+
await adapter.insert(key, owner, expiration);
|
|
191
|
+
const noneExsistingOwner = "b";
|
|
192
|
+
await adapter.removeIfOwner(key, noneExsistingOwner);
|
|
193
|
+
expect(await adapter.find(key)).toEqual({
|
|
194
|
+
owner,
|
|
195
|
+
expiration,
|
|
196
|
+
});
|
|
202
197
|
});
|
|
203
198
|
});
|
|
204
|
-
describe("method:
|
|
205
|
-
test("Should return
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
await adapter.
|
|
210
|
-
const expiration2 = ttl.multiply(2).toEndDate();
|
|
211
|
-
const owner2 = "c";
|
|
212
|
-
const result = await adapter.refresh(key, owner2, expiration2);
|
|
199
|
+
describe("method: updateExpirationIfOwner", () => {
|
|
200
|
+
test("Should return 0 when key doesnt exists", async () => {
|
|
201
|
+
const newExpiration = new Date("2025");
|
|
202
|
+
const noneExsistingKey = "key";
|
|
203
|
+
const owner = "b";
|
|
204
|
+
const result = await adapter.updateExpirationIfOwner(noneExsistingKey, owner, newExpiration);
|
|
213
205
|
expect(result).toBe(0);
|
|
214
206
|
});
|
|
215
|
-
test("
|
|
216
|
-
const key = "
|
|
217
|
-
const
|
|
218
|
-
const
|
|
219
|
-
await adapter.insert(key,
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
await adapter.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
207
|
+
test("should return 0 when when owner doesnt match", async () => {
|
|
208
|
+
const key = "key";
|
|
209
|
+
const ownerA = "a";
|
|
210
|
+
const expiration = new Date("2024");
|
|
211
|
+
await adapter.insert(key, ownerA, expiration);
|
|
212
|
+
const newExpiration = new Date("2025");
|
|
213
|
+
const ownerB = "b";
|
|
214
|
+
const result = await adapter.updateExpirationIfOwner(key, ownerB, newExpiration);
|
|
215
|
+
expect(result).toBe(0);
|
|
216
|
+
});
|
|
217
|
+
test("Should not update expiration when owner doesnt match", async () => {
|
|
218
|
+
const key = "key";
|
|
219
|
+
const ownerA = "a";
|
|
220
|
+
const expiration = new Date("2024");
|
|
221
|
+
await adapter.insert(key, ownerA, expiration);
|
|
222
|
+
const newExpiration = new Date("2025");
|
|
223
|
+
const ownerB = "b";
|
|
224
|
+
await adapter.updateExpirationIfOwner(key, ownerB, newExpiration);
|
|
225
|
+
expect(await adapter.find(key)).toEqual({
|
|
226
|
+
expiration,
|
|
227
|
+
owner: ownerA,
|
|
227
228
|
});
|
|
228
229
|
});
|
|
229
|
-
test("Should return
|
|
230
|
-
const key = "
|
|
231
|
-
const owner = "
|
|
232
|
-
const
|
|
233
|
-
await adapter.insert(key, owner,
|
|
234
|
-
const
|
|
235
|
-
const result = await adapter.
|
|
236
|
-
expect(result).
|
|
237
|
-
});
|
|
238
|
-
test("Should update
|
|
239
|
-
const key = "
|
|
240
|
-
const owner = "
|
|
241
|
-
const
|
|
242
|
-
await adapter.insert(key, owner,
|
|
243
|
-
const
|
|
244
|
-
await adapter.
|
|
245
|
-
|
|
246
|
-
|
|
230
|
+
test("Should return number greather than 0 when owner match", async () => {
|
|
231
|
+
const key = "key";
|
|
232
|
+
const owner = "a";
|
|
233
|
+
const expiration = new Date("2024");
|
|
234
|
+
await adapter.insert(key, owner, expiration);
|
|
235
|
+
const newExpiration = new Date("2025");
|
|
236
|
+
const result = await adapter.updateExpirationIfOwner(key, owner, newExpiration);
|
|
237
|
+
expect(result).toBeGreaterThan(0);
|
|
238
|
+
});
|
|
239
|
+
test("Should update expiration when owner match", async () => {
|
|
240
|
+
const key = "key";
|
|
241
|
+
const owner = "a";
|
|
242
|
+
const expiration = new Date("2024");
|
|
243
|
+
await adapter.insert(key, owner, expiration);
|
|
244
|
+
const newExpiration = new Date("2025");
|
|
245
|
+
await adapter.updateExpirationIfOwner(key, owner, newExpiration);
|
|
246
|
+
expect(await adapter.find(key)).toEqual({
|
|
247
|
+
expiration: newExpiration,
|
|
248
|
+
owner,
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
describe("method: find", () => {
|
|
253
|
+
test("Should return null when key doesnt exists", async () => {
|
|
254
|
+
const noneExsistingKey = "key";
|
|
255
|
+
const lockData = await adapter.find(noneExsistingKey);
|
|
256
|
+
expect(lockData).toBeNull();
|
|
257
|
+
});
|
|
258
|
+
test("Should return ILockData when key exists", async () => {
|
|
259
|
+
const key = "key";
|
|
260
|
+
const owner = "a";
|
|
261
|
+
const expiration = new Date();
|
|
262
|
+
await adapter.insert(key, owner, expiration);
|
|
263
|
+
const lockData = await adapter.find(key);
|
|
264
|
+
expect(lockData).toEqual({
|
|
247
265
|
owner,
|
|
248
|
-
expiration
|
|
266
|
+
expiration,
|
|
249
267
|
});
|
|
250
268
|
});
|
|
251
269
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-lock-adapter.test-suite.js","sourceRoot":"","sources":["../../../../src/lock/implementations/test-utilities/database-lock-adapter.test-suite.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"database-lock-adapter.test-suite.js","sourceRoot":"","sources":["../../../../src/lock/implementations/test-utilities/database-lock-adapter.test-suite.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAKN,MAAM,QAAQ,CAAC;AAChB,OAAO,EAGN,MAAM,qCAAqC,CAAC;AAC7C,OAAO,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