@unchainedshop/core-quotations 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-quotations",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"main": "lib/quotations-index.js",
|
|
5
5
|
"types": "lib/quotations-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",
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
"@unchainedshop/utils": "^3.1.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^22.13.
|
|
40
|
-
"
|
|
41
|
-
"ts-jest": "^29.2.5",
|
|
39
|
+
"@types/node": "^22.13.4",
|
|
40
|
+
"tsx": "^4.19.2",
|
|
42
41
|
"typescript": "^5.7.3"
|
|
43
42
|
}
|
|
44
43
|
}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
1
3
|
import { buildFindSelector } from './configureQuotationsModule.js';
|
|
2
4
|
|
|
3
5
|
describe('Quotation', () => {
|
|
4
6
|
describe('buildFindSelector', () => {
|
|
5
7
|
it('Return correct filter object when passed no argument', () => {
|
|
6
|
-
|
|
8
|
+
assert.deepStrictEqual(buildFindSelector({}), {});
|
|
7
9
|
});
|
|
8
10
|
|
|
9
11
|
it('Return correct filter object when passed queryString and userId', () => {
|
|
10
|
-
|
|
12
|
+
assert.deepStrictEqual(buildFindSelector({ queryString: 'hello world', userId: 'admin-id' }), {
|
|
11
13
|
userId: 'admin-id',
|
|
12
14
|
$text: { $search: 'hello world' },
|
|
13
15
|
});
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
it('Return correct filter object when passed userId', () => {
|
|
17
|
-
|
|
19
|
+
assert.deepStrictEqual(buildFindSelector({ userId: 'admin-id' }), { userId: 'admin-id' });
|
|
18
20
|
});
|
|
19
21
|
it('Return correct filter object when passed queryString', () => {
|
|
20
|
-
|
|
22
|
+
assert.deepStrictEqual(buildFindSelector({ queryString: 'hello world' }), {
|
|
21
23
|
$text: { $search: 'hello world' },
|
|
22
24
|
});
|
|
23
25
|
});
|
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
|
-
};
|