Skip to content

Commit 5087bbf

Browse files
authored
chore(jest): update version (#925)
* chore(jest): update version * miscellaneous other fixes for tests --------- Signed-off-by: Dan Selman <[email protected]>
1 parent d4c61e1 commit 5087bbf

30 files changed

+5691
-5568
lines changed

license-config.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"ignore": [
3+
"scripts/**",
4+
"**/*.zip",
5+
"**/changelog.txt",
6+
"**/*.tgz",
7+
"**/.git",
8+
"**/*.pegjs",
9+
"packages/concerto-cto/lib/parser.js",
10+
"**/jest.config.js",
11+
"packages/*/scripts/**",
12+
"**/generated/**",
13+
"node_modules",
14+
"**/out/**",
15+
"**/HEADER",
16+
"**/[.]*",
17+
"**/[.]*/**",
18+
"**/test/**",
19+
"**/*.cto",
20+
"**/*.d.ts",
21+
"**/*.md",
22+
"**/coverage/**",
23+
"log",
24+
"LICENSE",
25+
"HEADER",
26+
"packages/concerto-core/api.txt",
27+
"**/*.snap"
28+
],
29+
"license": "HEADER",
30+
"defaultFormat": {
31+
"prepend": "/*",
32+
"append": "*/"
33+
},
34+
"licenseFormats": {
35+
"js": {
36+
"prepend": "/*",
37+
"append": " */",
38+
"eachLine": {
39+
"prepend": " * "
40+
}
41+
},
42+
"ts": {
43+
"prepend": "/*",
44+
"append": " */",
45+
"eachLine": {
46+
"prepend": " * "
47+
}
48+
},
49+
"dotfile|^Dockerfile": {
50+
"eachLine": {
51+
"prepend": "# "
52+
}
53+
}
54+
},
55+
"trailingWhitespace": "TRIM"
56+
}

package-lock.json

Lines changed: 5518 additions & 4551 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"eslint": "8.2.0",
77
"jsdoc": "^4.0.2",
88
"glob": "^7.2.0",
9-
"license-check-and-add": "2.3.6",
9+
"license-check-and-add": "4.0.5",
1010
"nyc": "15.1.0",
1111
"semver": "7.5.4"
1212
},
@@ -29,73 +29,12 @@
2929
"scripts": {
3030
"coverage": "node ./scripts/coverage.js \"packages/concerto-*\" && nyc report -t coverage --cwd . --report-dir coverage --reporter=lcov && cat ./coverage/lcov.info",
3131
"pretest": "npm run licchk",
32-
"licchk": "license-check-and-add",
32+
"licchk": "license-check-and-add check -f license-config.json",
3333
"test": "npm test -ws",
3434
"build": "npm run build -ws"
3535
},
3636
"repository": {
3737
"type": "git",
3838
"url": "https://github.com/accordproject/concerto"
39-
},
40-
"license-check-and-add-config": {
41-
"folder": ".",
42-
"license": "HEADER",
43-
"exact_paths_method": "EXCLUDE",
44-
"exact_paths": [
45-
".git",
46-
".github",
47-
".gitattributes",
48-
".tern-project",
49-
"node_modules",
50-
"packages",
51-
"softhsm",
52-
"build.cfg",
53-
"README.md",
54-
"CONTRIBUTING.md",
55-
"DEVELOPERS.md",
56-
"NOTICES.md",
57-
"CHARTER.md",
58-
"ISSUE_TEMPLATE.md",
59-
"MAINTAINERS.md",
60-
"contrib-notes",
61-
"log",
62-
"LICENSE",
63-
"HEADER",
64-
"docs/",
65-
"umd/",
66-
"coverage",
67-
".DS_Store",
68-
"packages/concerto-core/api.txt",
69-
"coverage",
70-
"index.d.ts",
71-
"packages/concerto-core/introspect/parser.js",
72-
"node_modules",
73-
".nyc-output"
74-
],
75-
"file_type_method": "EXCLUDE",
76-
"file_types": [
77-
".yml",
78-
".yaml",
79-
".zip",
80-
".tgz"
81-
],
82-
"insert_license": false,
83-
"license_formats": {
84-
"js|njk|pegjs|cto|acl|qry": {
85-
"prepend": "/*",
86-
"append": " */",
87-
"eachLine": {
88-
"prepend": " * "
89-
}
90-
},
91-
"npmrc|editorconfig|txt": {
92-
"eachLine": {
93-
"prepend": "# "
94-
}
95-
},
96-
"md": {
97-
"file": "HEADER.md"
98-
}
99-
}
10039
}
10140
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} **/
2+
module.exports = {
3+
testEnvironment: 'node',
4+
transform: {
5+
'^.+.tsx?$': ['ts-jest', {}],
6+
},
7+
};

packages/concerto-analysis/package.json

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
"clean": "rimraf dist",
1414
"prebuild": "npm-run-all clean",
1515
"build": "tsc -p tsconfig.build.json",
16-
"pretest": "npm-run-all licchk lint",
16+
"pretest": "npm-run-all lint",
1717
"lint": "eslint .",
18-
"licchk": "license-check-and-add",
1918
"test": "jest",
2019
"test:watch": "jest --watchAll"
2120
},
@@ -37,73 +36,15 @@
3736
},
3837
"devDependencies": {
3938
"@accordproject/concerto-cto": "3.19.2",
40-
"@types/jest": "28.1.1",
39+
"@types/jest": "^29.5.13",
4140
"@types/semver": "7.3.10",
4241
"@typescript-eslint/eslint-plugin": "5.27.1",
4342
"@typescript-eslint/parser": "5.27.1",
4443
"eslint": "8.2.0",
45-
"jest": "28.1.1",
46-
"license-check-and-add": "2.3.6",
44+
"jest": "^29.7.0",
4745
"npm-run-all": "4.1.5",
4846
"rimraf": "6.0.1",
49-
"ts-jest": "28.0.4",
50-
"typescript": "5.6.3"
51-
},
52-
"license-check-and-add-config": {
53-
"folder": "./src",
54-
"license": "HEADER",
55-
"exact_paths_method": "EXCLUDE",
56-
"exact_paths": [
57-
"api.txt",
58-
"composer-logs",
59-
"coverage",
60-
"index.d.ts",
61-
"./system",
62-
"./introspect/parser.js",
63-
"LICENSE",
64-
"node_modules",
65-
".nyc-output",
66-
"out",
67-
".tern-project",
68-
"./generated/concerto.ts",
69-
"./generated/concerto.metamodel.ts"
70-
],
71-
"file_type_method": "EXCLUDE",
72-
"file_types": [
73-
".yml",
74-
".yaml",
75-
".zip",
76-
".tgz"
77-
],
78-
"insert_license": false,
79-
"license_formats": {
80-
"js|ts|njk|pegjs|cto|acl|qry": {
81-
"prepend": "/*",
82-
"append": " */",
83-
"eachLine": {
84-
"prepend": " * "
85-
}
86-
},
87-
"npmrc|editorconfig|txt": {
88-
"eachLine": {
89-
"prepend": "# "
90-
}
91-
},
92-
"md": {
93-
"file": "./HEADER.md"
94-
}
95-
}
96-
},
97-
"jest": {
98-
"preset": "ts-jest",
99-
"testEnvironment": "node",
100-
"testPathIgnorePatterns": [
101-
"<rootDir>/dist/",
102-
"/node_modules/"
103-
],
104-
"collectCoverage": true,
105-
"collectCoverageFrom": [
106-
"src/**/*.ts"
107-
]
47+
"ts-jest": "^29.2.5",
48+
"typescript": "^5.6.3"
10849
}
10950
}

packages/concerto-core/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class ModelLoader {
336336
+ ModelManager[] loadModelManagerFromModelFiles(object[],string[],object,boolean?,boolean?,number?)
337337
}
338338
class ModelManager extends BaseModelManager {
339-
+ void constructor(object?,boolean?,Object?,boolean?,boolean?)
339+
+ void constructor(object?,boolean?,Object?,boolean?,boolean?,boolean?,boolean?,object?,string?,string?,processFile?)
340340
+ ModelFile addCTOModel(string,string?,boolean?) throws IllegalModelException
341341
}
342342
+ object getRootModel()

packages/concerto-core/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
# Note that the latest public API is documented using JSDocs and is available in api.txt.
2525
#
2626

27+
Version 3.19.2 {844c910d1f8f61ab31c34e85d8c51546} 2024-10-21
28+
- update options for ModelManager
29+
2730
Version 3.19.2 {56bc38dc7305eee0a06f08a8cf639910} 2024-10-02
2831
- validateDecorators option added to ModelManager
2932
- update DecoratorManager to support validated decorators

packages/concerto-core/lib/decoratormanager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ class DecoratorManager {
800800
return true;
801801
} else {
802802
Warning.printDeprecationWarning(
803-
'Functionality for namespace targeted Decorator Command Sets has beed changed. Using namespace targets to apply decorators on all declarations in a namespace will be deprecated soon.',
803+
'Functionality for namespace targeted Decorator Command Sets has changed. Using namespace targets to apply decorators on all declarations in a namespace will be deprecated soon.',
804804
ErrorCodes.DEPRECATION_WARNING,
805805
ErrorCodes.CONCERTO_DEPRECATION_001,
806806
'Please refer to https://concerto.accordproject.org/deprecation/001'

packages/concerto-core/lib/introspect/decorator.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ class Decorator {
116116
const decoratedName = this.getParent().getFullyQualifiedName?.();
117117
const mm = mf.getModelManager();
118118
const validationOptions = mm.getDecoratorValidation();
119-
console.log(`ModelManager.validationOptions: ${JSON.stringify(validationOptions)}`);
120-
121119
if (validationOptions.missingDecorator || validationOptions.invalidDecorator) {
122120
try {
123121
// this throws if the type does not exist
@@ -184,7 +182,6 @@ class Decorator {
184182
}
185183
}
186184
catch (err) {
187-
console.log(err);
188185
this.handleError(validationOptions.missingDecorator, err);
189186
}
190187
}

packages/concerto-core/lib/modelmanager.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ class ModelManager extends BaseModelManager {
5959
* @param {object} [options] - ModelManager options, also passed to Serializer
6060
* @param {boolean} [options.strict] - require versioned namespaces and imports
6161
* @param {Object} [options.regExp] - An alternative regular expression engine.
62+
* @param {boolean} [options.metamodelValidation] - When true, modelfiles will be validated
63+
* @param {boolean} [options.addMetamodel] - When true, the Concerto metamodel is added to the model manager
6264
* @param {boolean} [options.enableMapType] - When true, the Concerto Map Type feature is enabled
63-
* @param {boolean} [options.importAliasing] - When true, the Concerto Map Type feature is enabled
65+
* @param {boolean} [options.importAliasing] - When true, the Concerto Aliasing feature is enabled
66+
* @param {object} [options.decoratorValidation] - the decorator validation configuration
67+
* @param {string} [options.decoratorValidation.missingDecorator] - the validation log level for missingDecorator decorators: off, warning, error
68+
* @param {string} [options.decoratorValidation.invalidDecorator] - the validation log level for invalidDecorator decorators: off, warning, error
69+
* @param {*} [processFile] - how to obtain a concerto AST from an input to the model manager
6470
*/
6571
constructor(options) {
6672
super(options, ctoProcessFile(options));

0 commit comments

Comments
 (0)