@unchainedshop/core-delivery 3.1.0 → 3.1.2
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-delivery",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"main": "lib/delivery-index.js",
|
|
5
5
|
"types": "lib/delivery-index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"build": "tsc -b",
|
|
10
10
|
"prepublishOnly": "npm run clean && npm run build",
|
|
11
11
|
"watch": "tsc -w",
|
|
12
|
-
"test": "
|
|
13
|
-
"test:watch": "
|
|
12
|
+
"test": "tsx --test",
|
|
13
|
+
"test:watch": "tsx --test --watch"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -37,9 +37,8 @@
|
|
|
37
37
|
"@unchainedshop/utils": "^3.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^22.13.
|
|
41
|
-
"
|
|
42
|
-
"ts-jest": "^29.2.5",
|
|
40
|
+
"@types/node": "^22.13.4",
|
|
41
|
+
"tsx": "^4.19.2",
|
|
43
42
|
"typescript": "^5.7.3"
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
1
3
|
import { DeliveryProviderType } from '../delivery-index.js';
|
|
2
4
|
import { buildFindSelector } from './configureDeliveryModule.js';
|
|
3
5
|
|
|
4
6
|
describe('Delivery', () => {
|
|
5
7
|
describe('buildFindSelector', () => {
|
|
6
8
|
it('Return correct filter object when passed no argument', () => {
|
|
7
|
-
|
|
9
|
+
assert.deepStrictEqual(buildFindSelector({}), { deleted: null });
|
|
8
10
|
});
|
|
9
11
|
|
|
10
|
-
it('Return correct filter object when passed
|
|
11
|
-
|
|
12
|
+
it('Return correct filter object when passed type', () => {
|
|
13
|
+
assert.deepStrictEqual(buildFindSelector({ type: DeliveryProviderType.PICKUP }), {
|
|
12
14
|
type: 'PICKUP',
|
|
13
15
|
deleted: null,
|
|
14
16
|
});
|
package/jest.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
-
export default {
|
|
3
|
-
preset: 'ts-jest/presets/default-esm', // or other ESM presets
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
extensionsToTreatAsEsm: ['.ts'],
|
|
6
|
-
transform: {
|
|
7
|
-
'^.+\\.tsx?$': [
|
|
8
|
-
'ts-jest',
|
|
9
|
-
{
|
|
10
|
-
useESM: true,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
},
|
|
14
|
-
moduleNameMapper: {
|
|
15
|
-
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
16
|
-
},
|
|
17
|
-
};
|