@labdigital/commercetools-mock 2.9.0 → 2.10.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 +9 -4
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/repositories/cart.ts +9 -0
- package/src/services/cart.test.ts +24 -0
package/README.md
CHANGED
|
@@ -42,9 +42,14 @@ const ctMock = new CommercetoolsMock({
|
|
|
42
42
|
})
|
|
43
43
|
|
|
44
44
|
describe('A module', () => {
|
|
45
|
+
const mswServer = setupServer()
|
|
46
|
+
|
|
45
47
|
beforeAll(() => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
mswServer.listen({ onUnhandledRequest: "error" })
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
ctMock.registerHandlers(mswServer)
|
|
48
53
|
|
|
49
54
|
ctMock.project().add('type', {
|
|
50
55
|
...getBaseResourceProperties()
|
|
@@ -54,11 +59,11 @@ describe('A module', () => {
|
|
|
54
59
|
})
|
|
55
60
|
|
|
56
61
|
afterAll(() => {
|
|
57
|
-
|
|
58
|
-
ctMock.stop()
|
|
62
|
+
mswServer.close()
|
|
59
63
|
})
|
|
60
64
|
|
|
61
65
|
afterEach(() => {
|
|
66
|
+
server.clearHandlers()
|
|
62
67
|
ctMock.clear()
|
|
63
68
|
})
|
|
64
69
|
|
package/dist/index.cjs
CHANGED
|
@@ -2352,6 +2352,8 @@ var CartRepository = class extends AbstractResourceRepository {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
resource.totalPrice.centAmount = calculateCartTotalPrice(resource);
|
|
2354
2354
|
},
|
|
2355
|
+
recalculate: () => {
|
|
2356
|
+
},
|
|
2355
2357
|
addItemShippingAddress: (context, resource, { action, address }) => {
|
|
2356
2358
|
const newAddress = createAddress(
|
|
2357
2359
|
address,
|