@reactionary/examples-node 0.3.16 → 0.3.17
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
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/examples-node",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@reactionary/core": "0.3.
|
|
8
|
-
"@reactionary/provider-commercetools": "0.3.
|
|
9
|
-
"@reactionary/provider-algolia": "0.3.
|
|
10
|
-
"@reactionary/provider-medusa": "0.3.
|
|
11
|
-
"@reactionary/provider-meilisearch": "0.3.
|
|
12
|
-
"@reactionary/provider-fake": "0.3.
|
|
7
|
+
"@reactionary/core": "0.3.17",
|
|
8
|
+
"@reactionary/provider-commercetools": "0.3.17",
|
|
9
|
+
"@reactionary/provider-algolia": "0.3.17",
|
|
10
|
+
"@reactionary/provider-medusa": "0.3.17",
|
|
11
|
+
"@reactionary/provider-meilisearch": "0.3.17",
|
|
12
|
+
"@reactionary/provider-fake": "0.3.17"
|
|
13
13
|
},
|
|
14
14
|
"type": "module"
|
|
15
15
|
}
|
|
@@ -2,7 +2,7 @@ import 'dotenv/config';
|
|
|
2
2
|
import { describe, expect, it, beforeEach, assert } from 'vitest';
|
|
3
3
|
import { createClient, PrimaryProvider } from '../utils.js';
|
|
4
4
|
|
|
5
|
-
describe.each([PrimaryProvider.COMMERCETOOLS])('Identity Capability - %s', (provider) => {
|
|
5
|
+
describe.each([PrimaryProvider.COMMERCETOOLS, PrimaryProvider.MEDUSA])('Identity Capability - %s', (provider) => {
|
|
6
6
|
let client: ReturnType<typeof createClient>;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
@@ -7,7 +7,7 @@ const testData = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
// FIXME: Currently broken in terms of actually looking up anything...
|
|
10
|
-
describe.each([PrimaryProvider.COMMERCETOOLS])(
|
|
10
|
+
describe.each([PrimaryProvider.COMMERCETOOLS, PrimaryProvider.FAKE, PrimaryProvider.MEDUSA])(
|
|
11
11
|
'Price Capability - %s',
|
|
12
12
|
(provider) => {
|
|
13
13
|
let client: ReturnType<typeof createClient>;
|
|
@@ -22,14 +22,14 @@ describe.each([PrimaryProvider.COMMERCETOOLS])(
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
if (!result.success) {
|
|
25
|
-
assert.fail();
|
|
25
|
+
assert.fail(JSON.stringify(result.error));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
expect(result.value.identifier.variant.sku).toBe(
|
|
29
29
|
testData.skuWithoutTiers
|
|
30
30
|
);
|
|
31
|
-
expect(result.value.unitPrice.value).
|
|
32
|
-
expect(result.value.unitPrice.currency).toBe('
|
|
31
|
+
expect(result.value.unitPrice.value).toBeDefined();
|
|
32
|
+
expect(result.value.unitPrice.currency).toBe('EUR');
|
|
33
33
|
expect(result.value.tieredPrices.length).toBe(0);
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -39,12 +39,12 @@ describe.each([PrimaryProvider.COMMERCETOOLS])(
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
if (!result.success) {
|
|
42
|
-
assert.fail();
|
|
42
|
+
assert.fail(JSON.stringify(result.error));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
expect(result.value.identifier.variant.sku).toBe(testData.skuWithoutTiers);
|
|
46
|
-
expect(result.value.unitPrice.value).
|
|
47
|
-
expect(result.value.unitPrice.currency).toBe('
|
|
46
|
+
expect(result.value.unitPrice.value).toBeDefined();
|
|
47
|
+
expect(result.value.unitPrice.currency).toBe('EUR');
|
|
48
48
|
expect(result.value.tieredPrices.length).toBe(0);
|
|
49
49
|
});
|
|
50
50
|
}
|
package/src/utils.ts
CHANGED
|
@@ -112,7 +112,7 @@ export function createClient(provider: PrimaryProvider) {
|
|
|
112
112
|
productAssociations: true,
|
|
113
113
|
orderSearch: true,
|
|
114
114
|
store: true,
|
|
115
|
-
profile: true
|
|
115
|
+
profile: true,
|
|
116
116
|
})
|
|
117
117
|
);
|
|
118
118
|
}
|
|
@@ -120,6 +120,9 @@ export function createClient(provider: PrimaryProvider) {
|
|
|
120
120
|
if (provider === PrimaryProvider.FAKE) {
|
|
121
121
|
builder = builder.withCapability(
|
|
122
122
|
withFakeCapabilities( getFakeConfiguration() , {
|
|
123
|
+
price: true,
|
|
124
|
+
inventory: true,
|
|
125
|
+
product: true,
|
|
123
126
|
productReviews: true,
|
|
124
127
|
productAssociations: true,
|
|
125
128
|
}
|