c2-clinical 1.0.118 → 1.0.119

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.
@@ -73,7 +73,11 @@ class BuildTreeFlowItem {
73
73
  lines?.forEach((line, index) => {
74
74
  line.collumns?.sort((a, b) => a.column - b.column);
75
75
  line.collumns?.forEach((collumn) => {
76
- const newChildren = this.bank.filter((child) => child.parent?._id?.toString() === collumn?._id?.toString());
76
+ const newChildren = this.bank.filter((child) => {
77
+ const parentId = child.parent?._id?.toString() ?? child.parent;
78
+ const _id = collumn?._id?.toString() ?? collumn._id;
79
+ return parentId === _id;
80
+ });
77
81
  if (newChildren?.length) {
78
82
  collumn.lines = this.buildRows({ parent: collumn, children: newChildren });
79
83
  }
@@ -8,6 +8,9 @@ const ExecFormulaFlowItem_1 = __importDefault(require("../../item/ExecFormulaFlo
8
8
  class GetEnablesFormUnitsFlowItem {
9
9
  execute(formUnits, answers) {
10
10
  return formUnits?.filter((unit) => {
11
+ if (unit._id.toString() === "68efa8f2fbcea8e6b466aed4") {
12
+ console.log("DEBUG ENABLED");
13
+ }
11
14
  // if (!unit.show) return false;
12
15
  if (!unit.active)
13
16
  return false;
package/jest.config.js ADDED
@@ -0,0 +1,20 @@
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
+ module.exports = {
3
+ preset: "ts-jest",
4
+ testEnvironment: "node",
5
+ roots: ["<rootDir>/src"],
6
+ testMatch: ["**/*.test.ts"],
7
+ // coverageProvider: "v8",
8
+ // coverageThreshold: {
9
+ // global: {
10
+ // lines: 90,
11
+ // statements: 90
12
+ // }
13
+ // },
14
+ collectCoverageFrom: [
15
+ "src/flow/**/*.ts",
16
+ "!<rootDir>/node_modules/",
17
+ "!<rootDir>/dist/",
18
+ "!<rootDir>/resources/",
19
+ ],
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.118",
3
+ "version": "1.0.119",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://github.com/cabralsilva/c2-clinical.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",
@@ -8,7 +8,8 @@
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
10
10
  "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1",
11
+ "test": "jest",
12
+ "test:coverage": "jest --coverage --coverageReporters='text-summary'",
12
13
  "format": "prettier --write .",
13
14
  "build": "tsc --skipLibCheck",
14
15
  "preversion": "tsc --skipLibCheck",
@@ -22,16 +23,20 @@
22
23
  "crypto": "^1.0.1",
23
24
  "mongoose": "^8.3.4",
24
25
  "ts-node": "^10.8.1",
25
- "typescript": "^5.8.3"
26
+ "typescript": "^5.9.3"
26
27
  },
27
28
  "devDependencies": {
29
+ "@types/jest": "^30.0.0",
28
30
  "@types/mongoose": "^5.11.97",
29
31
  "@types/node": "^24.9.2",
30
32
  "@typescript-eslint/eslint-plugin": "^8.35.0",
31
33
  "@typescript-eslint/parser": "^8.35.0",
32
34
  "eslint": "^9.29.0",
33
35
  "eslint-config-prettier": "^10.1.5",
36
+ "eslint-plugin-jest": "^29.0.1",
34
37
  "eslint-plugin-prettier": "^5.5.1",
35
- "prettier": "^3.6.2"
38
+ "jest": "^30.2.0",
39
+ "prettier": "^3.6.2",
40
+ "ts-jest": "^29.4.5"
36
41
  }
37
42
  }