@nest-yalc-2/api-strategy 2.2.1 → 2.2.3
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/package.json +10 -2
- package/src/__tests__/call-strategy-wrappers.spec.ts +217 -217
- package/src/__tests__/context-call.service.spec.ts +52 -52
- package/src/__tests__/context-event.service.spec.ts +52 -52
- package/src/__tests__/event-strategy-composition.spec.ts +185 -185
- package/src/__tests__/header-whitelist.helper.spec.ts +41 -30
- package/src/__tests__/http-abstract-call.strategy.spec.ts +17 -17
- package/src/__tests__/nest-http-call.strategy.spec.ts +164 -164
- package/src/__tests__/nest-local-call.strategy.spec.ts +263 -263
- package/src/__tests__/nest-local-event.strategy.spec.ts +55 -55
- package/src/__tests__/rabbitmq-event.strategy.spec.ts +220 -220
- package/src/__tests__/strategy-selector.provider.spec.ts +182 -182
- package/src/context-call.interface.ts +49 -49
- package/src/context-call.service.ts +31 -31
- package/src/context-event.interface.ts +4 -4
- package/src/context-event.service.ts +31 -31
- package/src/header-whitelist.helper.ts +12 -12
- package/src/index.ts +17 -17
- package/src/strategies/composite-event.strategy.ts +76 -76
- package/src/strategies/conditional-call.strategy.ts +70 -70
- package/src/strategies/conditional-event.strategy.ts +54 -54
- package/src/strategies/fallback-call.strategy.ts +67 -67
- package/src/strategies/http-abstract-call.strategy.ts +238 -238
- package/src/strategies/nest-http-call.strategy.ts +121 -121
- package/src/strategies/nest-local-call.strategy.ts +153 -153
- package/src/strategies/nest-local-event.strategy.d.ts +1 -1
- package/src/strategies/nest-local-event.strategy.ts +42 -42
- package/src/strategies/rabbitmq-event.strategy.ts +154 -154
- package/src/strategies/shadow-call.strategy.ts +87 -87
- package/src/strategy-selector.provider.ts +103 -103
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
import { jest, describe, expect, it } from "@jest/globals";
|
|
2
|
-
import type { IEventStrategy } from "../context-event.interface.js";
|
|
3
|
-
import { CompositeEventStrategy } from "../strategies/composite-event.strategy.js";
|
|
4
|
-
import { ConditionalEventStrategy } from "../strategies/conditional-event.strategy.js";
|
|
5
|
-
|
|
6
|
-
function eventStrategy(
|
|
7
|
-
overrides: Partial<IEventStrategy<object, boolean>> & {
|
|
8
|
-
onModuleDestroy?: () => Promise<void>;
|
|
9
|
-
} = {}
|
|
10
|
-
) {
|
|
11
|
-
return {
|
|
12
|
-
emit: jest.fn(() => true),
|
|
13
|
-
emitAsync: jest.fn(async () => true),
|
|
14
|
-
...overrides,
|
|
15
|
-
} satisfies IEventStrategy<object, boolean> & {
|
|
16
|
-
onModuleDestroy?: () => Promise<void>;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
describe("CompositeEventStrategy", () => {
|
|
21
|
-
it("requires at least one strategy", () => {
|
|
22
|
-
expect(() => new CompositeEventStrategy([])).toThrow("at least one");
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("emits to every strategy synchronously", () => {
|
|
26
|
-
const first = eventStrategy();
|
|
27
|
-
const second = eventStrategy({ emit: jest.fn(() => false) });
|
|
28
|
-
const strategy = new CompositeEventStrategy([first, second]);
|
|
29
|
-
|
|
30
|
-
const result = strategy.emit("event.name", { ok: true });
|
|
31
|
-
|
|
32
|
-
expect(result).toEqual([true, false]);
|
|
33
|
-
expect(first.emit).toHaveBeenCalledWith(
|
|
34
|
-
"event.name",
|
|
35
|
-
{ ok: true },
|
|
36
|
-
undefined
|
|
37
|
-
);
|
|
38
|
-
expect(second.emit).toHaveBeenCalledWith(
|
|
39
|
-
"event.name",
|
|
40
|
-
{ ok: true },
|
|
41
|
-
undefined
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("throws sync errors by default", () => {
|
|
46
|
-
const error = new Error("sync failure");
|
|
47
|
-
const strategy = new CompositeEventStrategy([
|
|
48
|
-
eventStrategy({
|
|
49
|
-
emit: jest.fn(() => {
|
|
50
|
-
throw error;
|
|
51
|
-
}),
|
|
52
|
-
}),
|
|
53
|
-
]);
|
|
54
|
-
|
|
55
|
-
expect(() => strategy.emit("event.name", {})).toThrow(error);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("ignores sync errors when configured", () => {
|
|
59
|
-
const strategy = new CompositeEventStrategy(
|
|
60
|
-
[
|
|
61
|
-
eventStrategy({
|
|
62
|
-
emit: jest.fn(() => {
|
|
63
|
-
throw new Error("sync failure");
|
|
64
|
-
}),
|
|
65
|
-
}),
|
|
66
|
-
eventStrategy(),
|
|
67
|
-
],
|
|
68
|
-
{ errorMode: "ignore" }
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
expect(strategy.emit("event.name", {})).toEqual([true]);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("emits to every strategy asynchronously", async () => {
|
|
75
|
-
const first = eventStrategy();
|
|
76
|
-
const second = eventStrategy({ emitAsync: jest.fn(async () => false) });
|
|
77
|
-
const strategy = new CompositeEventStrategy([first, second]);
|
|
78
|
-
|
|
79
|
-
await expect(
|
|
80
|
-
strategy.emitAsync("event.name", { ok: true })
|
|
81
|
-
).resolves.toEqual([true, false]);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("throws async errors by default", async () => {
|
|
85
|
-
const error = new Error("async failure");
|
|
86
|
-
const strategy = new CompositeEventStrategy([
|
|
87
|
-
eventStrategy({
|
|
88
|
-
emitAsync: jest.fn(async () => {
|
|
89
|
-
throw error;
|
|
90
|
-
}),
|
|
91
|
-
}),
|
|
92
|
-
]);
|
|
93
|
-
|
|
94
|
-
await expect(strategy.emitAsync("event.name", {})).rejects.toThrow(error);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it("ignores async errors when configured", async () => {
|
|
98
|
-
const strategy = new CompositeEventStrategy(
|
|
99
|
-
[
|
|
100
|
-
eventStrategy({
|
|
101
|
-
emitAsync: jest.fn(async () => {
|
|
102
|
-
throw new Error("async failure");
|
|
103
|
-
}),
|
|
104
|
-
}),
|
|
105
|
-
eventStrategy(),
|
|
106
|
-
],
|
|
107
|
-
{ errorMode: "ignore" }
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
await expect(strategy.emitAsync("event.name", {})).resolves.toEqual([true]);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it("destroys nested strategies that implement module destroy", async () => {
|
|
114
|
-
const onModuleDestroy = jest.fn(async () => undefined);
|
|
115
|
-
const strategy = new CompositeEventStrategy([
|
|
116
|
-
eventStrategy({ onModuleDestroy }),
|
|
117
|
-
eventStrategy(),
|
|
118
|
-
]);
|
|
119
|
-
|
|
120
|
-
await strategy.onModuleDestroy();
|
|
121
|
-
|
|
122
|
-
expect(onModuleDestroy).toHaveBeenCalled();
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
describe("ConditionalEventStrategy", () => {
|
|
127
|
-
it("emits when enabled", () => {
|
|
128
|
-
const target = eventStrategy();
|
|
129
|
-
const strategy = new ConditionalEventStrategy(target, {
|
|
130
|
-
enabled: () => true,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
expect(strategy.emit("event.name", {})).toBe(true);
|
|
134
|
-
expect(target.emit).toHaveBeenCalled();
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it("returns the disabled result when disabled", () => {
|
|
138
|
-
const target = eventStrategy();
|
|
139
|
-
const strategy = new ConditionalEventStrategy(target, {
|
|
140
|
-
enabled: false,
|
|
141
|
-
disabledResult: false,
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
expect(strategy.emit("event.name", {})).toBe(false);
|
|
145
|
-
expect(target.emit).not.toHaveBeenCalled();
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it("skips events rejected by the predicate", async () => {
|
|
149
|
-
const target = eventStrategy();
|
|
150
|
-
const strategy = new ConditionalEventStrategy(target, {
|
|
151
|
-
shouldEmit: () => false,
|
|
152
|
-
disabledResult: false,
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
await expect(strategy.emitAsync("event.name", {})).resolves.toBe(false);
|
|
156
|
-
expect(target.emitAsync).not.toHaveBeenCalled();
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it("delegates async events when enabled and accepted", async () => {
|
|
160
|
-
const target = eventStrategy();
|
|
161
|
-
const strategy = new ConditionalEventStrategy(target, {
|
|
162
|
-
shouldEmit: () => true,
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
await expect(strategy.emitAsync("event.name", {})).resolves.toBe(true);
|
|
166
|
-
expect(target.emitAsync).toHaveBeenCalled();
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it("destroys the wrapped strategy when supported", async () => {
|
|
170
|
-
const onModuleDestroy = jest.fn(async () => undefined);
|
|
171
|
-
const strategy = new ConditionalEventStrategy(
|
|
172
|
-
eventStrategy({ onModuleDestroy })
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
await strategy.onModuleDestroy();
|
|
176
|
-
|
|
177
|
-
expect(onModuleDestroy).toHaveBeenCalled();
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it("ignores destroy when the wrapped strategy has no lifecycle hook", async () => {
|
|
181
|
-
const strategy = new ConditionalEventStrategy(eventStrategy());
|
|
182
|
-
|
|
183
|
-
await expect(strategy.onModuleDestroy()).resolves.toBeUndefined();
|
|
184
|
-
});
|
|
185
|
-
});
|
|
1
|
+
import { jest, describe, expect, it } from "@jest/globals";
|
|
2
|
+
import type { IEventStrategy } from "../context-event.interface.js";
|
|
3
|
+
import { CompositeEventStrategy } from "../strategies/composite-event.strategy.js";
|
|
4
|
+
import { ConditionalEventStrategy } from "../strategies/conditional-event.strategy.js";
|
|
5
|
+
|
|
6
|
+
function eventStrategy(
|
|
7
|
+
overrides: Partial<IEventStrategy<object, boolean>> & {
|
|
8
|
+
onModuleDestroy?: () => Promise<void>;
|
|
9
|
+
} = {}
|
|
10
|
+
) {
|
|
11
|
+
return {
|
|
12
|
+
emit: jest.fn(() => true),
|
|
13
|
+
emitAsync: jest.fn(async () => true),
|
|
14
|
+
...overrides,
|
|
15
|
+
} satisfies IEventStrategy<object, boolean> & {
|
|
16
|
+
onModuleDestroy?: () => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe("CompositeEventStrategy", () => {
|
|
21
|
+
it("requires at least one strategy", () => {
|
|
22
|
+
expect(() => new CompositeEventStrategy([])).toThrow("at least one");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("emits to every strategy synchronously", () => {
|
|
26
|
+
const first = eventStrategy();
|
|
27
|
+
const second = eventStrategy({ emit: jest.fn(() => false) });
|
|
28
|
+
const strategy = new CompositeEventStrategy([first, second]);
|
|
29
|
+
|
|
30
|
+
const result = strategy.emit("event.name", { ok: true });
|
|
31
|
+
|
|
32
|
+
expect(result).toEqual([true, false]);
|
|
33
|
+
expect(first.emit).toHaveBeenCalledWith(
|
|
34
|
+
"event.name",
|
|
35
|
+
{ ok: true },
|
|
36
|
+
undefined
|
|
37
|
+
);
|
|
38
|
+
expect(second.emit).toHaveBeenCalledWith(
|
|
39
|
+
"event.name",
|
|
40
|
+
{ ok: true },
|
|
41
|
+
undefined
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("throws sync errors by default", () => {
|
|
46
|
+
const error = new Error("sync failure");
|
|
47
|
+
const strategy = new CompositeEventStrategy([
|
|
48
|
+
eventStrategy({
|
|
49
|
+
emit: jest.fn(() => {
|
|
50
|
+
throw error;
|
|
51
|
+
}),
|
|
52
|
+
}),
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
expect(() => strategy.emit("event.name", {})).toThrow(error);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("ignores sync errors when configured", () => {
|
|
59
|
+
const strategy = new CompositeEventStrategy(
|
|
60
|
+
[
|
|
61
|
+
eventStrategy({
|
|
62
|
+
emit: jest.fn(() => {
|
|
63
|
+
throw new Error("sync failure");
|
|
64
|
+
}),
|
|
65
|
+
}),
|
|
66
|
+
eventStrategy(),
|
|
67
|
+
],
|
|
68
|
+
{ errorMode: "ignore" }
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(strategy.emit("event.name", {})).toEqual([true]);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("emits to every strategy asynchronously", async () => {
|
|
75
|
+
const first = eventStrategy();
|
|
76
|
+
const second = eventStrategy({ emitAsync: jest.fn(async () => false) });
|
|
77
|
+
const strategy = new CompositeEventStrategy([first, second]);
|
|
78
|
+
|
|
79
|
+
await expect(
|
|
80
|
+
strategy.emitAsync("event.name", { ok: true })
|
|
81
|
+
).resolves.toEqual([true, false]);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("throws async errors by default", async () => {
|
|
85
|
+
const error = new Error("async failure");
|
|
86
|
+
const strategy = new CompositeEventStrategy([
|
|
87
|
+
eventStrategy({
|
|
88
|
+
emitAsync: jest.fn(async () => {
|
|
89
|
+
throw error;
|
|
90
|
+
}),
|
|
91
|
+
}),
|
|
92
|
+
]);
|
|
93
|
+
|
|
94
|
+
await expect(strategy.emitAsync("event.name", {})).rejects.toThrow(error);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("ignores async errors when configured", async () => {
|
|
98
|
+
const strategy = new CompositeEventStrategy(
|
|
99
|
+
[
|
|
100
|
+
eventStrategy({
|
|
101
|
+
emitAsync: jest.fn(async () => {
|
|
102
|
+
throw new Error("async failure");
|
|
103
|
+
}),
|
|
104
|
+
}),
|
|
105
|
+
eventStrategy(),
|
|
106
|
+
],
|
|
107
|
+
{ errorMode: "ignore" }
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
await expect(strategy.emitAsync("event.name", {})).resolves.toEqual([true]);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("destroys nested strategies that implement module destroy", async () => {
|
|
114
|
+
const onModuleDestroy = jest.fn(async () => undefined);
|
|
115
|
+
const strategy = new CompositeEventStrategy([
|
|
116
|
+
eventStrategy({ onModuleDestroy }),
|
|
117
|
+
eventStrategy(),
|
|
118
|
+
]);
|
|
119
|
+
|
|
120
|
+
await strategy.onModuleDestroy();
|
|
121
|
+
|
|
122
|
+
expect(onModuleDestroy).toHaveBeenCalled();
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
describe("ConditionalEventStrategy", () => {
|
|
127
|
+
it("emits when enabled", () => {
|
|
128
|
+
const target = eventStrategy();
|
|
129
|
+
const strategy = new ConditionalEventStrategy(target, {
|
|
130
|
+
enabled: () => true,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
expect(strategy.emit("event.name", {})).toBe(true);
|
|
134
|
+
expect(target.emit).toHaveBeenCalled();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("returns the disabled result when disabled", () => {
|
|
138
|
+
const target = eventStrategy();
|
|
139
|
+
const strategy = new ConditionalEventStrategy(target, {
|
|
140
|
+
enabled: false,
|
|
141
|
+
disabledResult: false,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
expect(strategy.emit("event.name", {})).toBe(false);
|
|
145
|
+
expect(target.emit).not.toHaveBeenCalled();
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("skips events rejected by the predicate", async () => {
|
|
149
|
+
const target = eventStrategy();
|
|
150
|
+
const strategy = new ConditionalEventStrategy(target, {
|
|
151
|
+
shouldEmit: () => false,
|
|
152
|
+
disabledResult: false,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
await expect(strategy.emitAsync("event.name", {})).resolves.toBe(false);
|
|
156
|
+
expect(target.emitAsync).not.toHaveBeenCalled();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it("delegates async events when enabled and accepted", async () => {
|
|
160
|
+
const target = eventStrategy();
|
|
161
|
+
const strategy = new ConditionalEventStrategy(target, {
|
|
162
|
+
shouldEmit: () => true,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
await expect(strategy.emitAsync("event.name", {})).resolves.toBe(true);
|
|
166
|
+
expect(target.emitAsync).toHaveBeenCalled();
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it("destroys the wrapped strategy when supported", async () => {
|
|
170
|
+
const onModuleDestroy = jest.fn(async () => undefined);
|
|
171
|
+
const strategy = new ConditionalEventStrategy(
|
|
172
|
+
eventStrategy({ onModuleDestroy })
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
await strategy.onModuleDestroy();
|
|
176
|
+
|
|
177
|
+
expect(onModuleDestroy).toHaveBeenCalled();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("ignores destroy when the wrapped strategy has no lifecycle hook", async () => {
|
|
181
|
+
const strategy = new ConditionalEventStrategy(eventStrategy());
|
|
182
|
+
|
|
183
|
+
await expect(strategy.onModuleDestroy()).resolves.toBeUndefined();
|
|
184
|
+
});
|
|
185
|
+
});
|
|
@@ -1,30 +1,41 @@
|
|
|
1
|
-
import { describe, it, expect } from '@jest/globals';
|
|
2
|
-
|
|
3
|
-
import { filterHeaders } from '../header-whitelist.helper.js';
|
|
4
|
-
|
|
5
|
-
describe('whitelistHeaders', () => {
|
|
6
|
-
it('should be defined', () => {
|
|
7
|
-
expect(filterHeaders).toBeDefined();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('should filter headers', () => {
|
|
11
|
-
const headers = {
|
|
12
|
-
'x-header': 'x-header',
|
|
13
|
-
'x-header-2': 'x-header-2',
|
|
14
|
-
'x-header-3': 'x-header-3',
|
|
15
|
-
};
|
|
16
|
-
const whitelist = ['x-header', 'x-header-2'];
|
|
17
|
-
const filteredHeaders = filterHeaders(headers, whitelist);
|
|
18
|
-
expect(filteredHeaders).toEqual({
|
|
19
|
-
'x-header': 'x-header',
|
|
20
|
-
'x-header-2': 'x-header-2',
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('should return undefined if headers are undefined', () => {
|
|
25
|
-
const headers = undefined;
|
|
26
|
-
const whitelist = ['x-header', 'x-header-2'];
|
|
27
|
-
const filteredHeaders = filterHeaders(headers, whitelist);
|
|
28
|
-
expect(filteredHeaders).toBeUndefined();
|
|
29
|
-
});
|
|
30
|
-
|
|
1
|
+
import { describe, it, expect } from '@jest/globals';
|
|
2
|
+
|
|
3
|
+
import { filterHeaders } from '../header-whitelist.helper.js';
|
|
4
|
+
|
|
5
|
+
describe('whitelistHeaders', () => {
|
|
6
|
+
it('should be defined', () => {
|
|
7
|
+
expect(filterHeaders).toBeDefined();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should filter headers', () => {
|
|
11
|
+
const headers = {
|
|
12
|
+
'x-header': 'x-header',
|
|
13
|
+
'x-header-2': 'x-header-2',
|
|
14
|
+
'x-header-3': 'x-header-3',
|
|
15
|
+
};
|
|
16
|
+
const whitelist = ['x-header', 'x-header-2'];
|
|
17
|
+
const filteredHeaders = filterHeaders(headers, whitelist);
|
|
18
|
+
expect(filteredHeaders).toEqual({
|
|
19
|
+
'x-header': 'x-header',
|
|
20
|
+
'x-header-2': 'x-header-2',
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('should return undefined if headers are undefined', () => {
|
|
25
|
+
const headers = undefined;
|
|
26
|
+
const whitelist = ['x-header', 'x-header-2'];
|
|
27
|
+
const filteredHeaders = filterHeaders(headers, whitelist);
|
|
28
|
+
expect(filteredHeaders).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should use default whitelist', () => {
|
|
32
|
+
const headers = {
|
|
33
|
+
'Authorization': 'Bearer 123',
|
|
34
|
+
'x-header-2': 'x-header-2',
|
|
35
|
+
};
|
|
36
|
+
const filteredHeaders = filterHeaders(headers);
|
|
37
|
+
expect(filteredHeaders).toEqual({
|
|
38
|
+
'Authorization': 'Bearer 123'
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
expect,
|
|
3
|
-
jest,
|
|
4
|
-
describe,
|
|
5
|
-
it,
|
|
6
|
-
beforeEach,
|
|
7
|
-
beforeAll,
|
|
8
|
-
afterAll,
|
|
9
|
-
afterEach,
|
|
10
|
-
} from '@jest/globals';
|
|
11
|
-
import { HttpAbstractStrategy } from '../strategies/http-abstract-call.strategy.js';
|
|
12
|
-
|
|
13
|
-
describe('HttpAbstractStrategy', () => {
|
|
14
|
-
it('should be defined', () => {
|
|
15
|
-
expect(HttpAbstractStrategy).toBeDefined();
|
|
16
|
-
});
|
|
17
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
expect,
|
|
3
|
+
jest,
|
|
4
|
+
describe,
|
|
5
|
+
it,
|
|
6
|
+
beforeEach,
|
|
7
|
+
beforeAll,
|
|
8
|
+
afterAll,
|
|
9
|
+
afterEach,
|
|
10
|
+
} from '@jest/globals';
|
|
11
|
+
import { HttpAbstractStrategy } from '../strategies/http-abstract-call.strategy.js';
|
|
12
|
+
|
|
13
|
+
describe('HttpAbstractStrategy', () => {
|
|
14
|
+
it('should be defined', () => {
|
|
15
|
+
expect(HttpAbstractStrategy).toBeDefined();
|
|
16
|
+
});
|
|
17
|
+
});
|