Skip to content

Commit e7144da

Browse files
authored
Merge pull request #14 from Anshukumar123975/main
Change the method of Add CTO, Remove vitest test files, and Workflow Updates
2 parents 49f8740 + ab1c0b5 commit e7144da

File tree

14 files changed

+15
-637
lines changed

14 files changed

+15
-637
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
- name: Install Dependencies
2525
run: npm install
2626

27-
- name: Run Unit Tests
27+
- name: Run Conformance Tests
2828
run: npm test
29-
29+

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"main": "index.js",
66
"type": "module",
77
"scripts": {
8-
"test": "npx vitest semantic/specifications/",
9-
"bdd": "cucumber-js --loader ts-node/esm --import semantic/features/support/**/*.ts semantic/features"
8+
"test": "cucumber-js \"semantic/features/**/*.feature\" --loader ts-node/esm --import \"semantic/features/support/**/*.ts\" --tags \"not @skip\""
109
},
1110
"keywords": [],
1211
"author": "",
1312
"license": "ISC",
1413
"dependencies": {
1514
"@accordproject/concerto-core": "^3.21.0",
15+
"@accordproject/concerto-cto": "^3.22.0",
1616
"fs": "^0.0.1-security",
1717
"path": "^0.12.7",
1818
"vitest": "^3.2.1"

semantic/features/enums.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Feature: Semantic Validation of Enum Declarations in CTO Models
2222
When I validate the models
2323
Then no error should be thrown
2424

25+
@skip
2526
Scenario: Enum name conflicts with imported enum should throw an error
2627
Given I load the following models:
2728
| model_file | alias |

semantic/features/imports.feature

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Feature: Semantic Validation of CTO Model Imports
88
When I validate the models
99
Then no error should be thrown
1010

11+
@skip
1112
Scenario: Conflict with imported type name should throw an error
1213
Given I load the following models:
1314
| model_file | alias |
@@ -39,7 +40,8 @@ Feature: Semantic Validation of CTO Model Imports
3940
| imports/models/MODEL_FILE_002/model_file_002_unique_namespace_imports.cto | main |
4041
When I validate the models
4142
Then no error should be thrown
42-
43+
44+
@skip
4345
Scenario: Duplicate namespace imports should throw an error
4446
Given I load the following models:
4547
| model_file | alias |

semantic/features/namespaces.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Feature: Semantic Validation of CTO Namespace Imports
22

3+
@skip
34
Scenario: Invalid duplicate namespace imports should throw an error
45
Given I load the following models:
56
| model_file | alias |

semantic/features/support/steps.ts renamed to semantic/features/support/Javascript/steps.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import { Given, When, Then } from '@cucumber/cucumber';
22
import { loadCTO } from './utils/loadCTO.ts';
3+
import { Parser } from '@accordproject/concerto-cto';
4+
import { ModelFile } from '@accordproject/concerto-core';
35
import assert from 'assert';
46

57
Given('I load the following models:', function (dataTable) {
68
for (const row of dataTable.hashes()) {
79
const modelContent = loadCTO(row.model_file);
810
try {
9-
this.modelManager.addCTOModel(modelContent, row.model_file, true);
11+
// this.modelManager.addCTOModel(modelContent, row.model_file, true);
12+
const ast = Parser.parse(modelContent, row.model_file);
13+
const modelFile = new ModelFile(this.modelManager, ast, modelContent, row.model_file);
14+
this.modelManager.addModelFile(modelFile, null, modelFile.getName(), true);
1015
} catch (err) {
1116
this.error = err as Error;
1217
break;
File renamed without changes.

semantic/specifications/concepts/tests/concepts.test.js

Lines changed: 0 additions & 330 deletions
This file was deleted.

semantic/specifications/enums/tests/enums.test.js

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)