Skip to content

Commit

Permalink
chore: update to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Nov 18, 2024
1 parent 870c42a commit ba7a461
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 47 deletions.
36 changes: 10 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"mocha": "^10.3.0",
"npm-run-all2": "^7.0.0",
"rollup": "^4.12.1",
"xsd-schema-validator": "^0.7.0"
"xsd-schema-validator": "^0.10.0"
},
"dependencies": {
"min-dash": "^4.2.1",
Expand Down
26 changes: 6 additions & 20 deletions test/xml-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,13 @@ export function toXML(element, opts) {
return element.$model.toXML(element, opts);
}

export function validate(xml) {
export async function validate(xml) {

return new Promise(function(resolve, reject) {
if (!xml) {
throw new Error('XML is not defined');
}

if (!xml) {
return reject(new Error('XML is not defined'));
}
const result = await SchemaValidator.validateXML(xml, BPMN_XSD);

SchemaValidator.validateXML(xml, BPMN_XSD, function(err, result) {

if (err) {
return reject(err);
}

try {
expect(result.valid).to.be.true;
} catch (err) {
return reject(err);
}

return resolve();
});
});
expect(result.valid).to.be.true;
}

0 comments on commit ba7a461

Please sign in to comment.