Skip to content

Commit

Permalink
Fixed fast-xml-parser issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BBE78 committed Sep 11, 2024
1 parent d32b3f9 commit 20cb849
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x, 22.x]
cypress-version: [4.x, 5.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x, 13.x]
fail-fast: false
steps:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-sonarqube-reporter",
"version": "1.13.1",
"version": "1.13.2",
"description": "A SonarQube XML reporter for Cypress",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"homepage": "https://github.com/BBE78/cypress-sonarqube-reporter#readme",
"dependencies": {
"chalk": "^4.1.2",
"fast-xml-parser": "^4.4.1",
"fast-xml-parser": "^4.5.0",
"fs-extra": "^10.0.0",
"mocha": "^9.1.3",
"readdirp": "^3.6.0",
Expand Down
3 changes: 1 addition & 2 deletions src/MergeReports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fse = require('fs-extra');
const { XMLParser} = require('fast-xml-parser');
const parser = new XMLParser();
const path = require('path');
const readdirp = require('readdirp');
const {
Expand Down Expand Up @@ -88,7 +87,7 @@ const loadReport = (reportPath) => {
if (err) {
reject(err);
} else {
const json = parser.parse(xml, XML_PARSER_OPTIONS);
const json = new XMLParser(XML_PARSER_OPTIONS).parse(xml);
resolve(json);
}
});
Expand Down
6 changes: 3 additions & 3 deletions test/specs/TestUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fse = require('fs-extra');
const parser = require('fast-xml-parser');
const { XMLParser } = require('fast-xml-parser');
const { resolve } = require('path');
const rimraf = require('rimraf');

Expand Down Expand Up @@ -33,12 +33,12 @@ const verifyGeneratedReport = (reportPath, options, specFileName = 'Sample.spec.
const titleSeparator = options?.titleSeparator ?? ' - ';
const useFullTitle = (options && options.useFullTitle === false) ? false : true;
const xml = fse.readFileSync(reportPath, { encoding: 'utf8' });
const json = parser.parse(xml, {
const json = new XMLParser({
ignoreAttributes: false,
parseAttributeValue: true,
attributeNamePrefix: '_',
textNodeName: 'text'
});
}).parse(xml);

expect(json).toBeDefined();
expect(json.testExecutions).toBeDefined();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1851,10 +1851,10 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=

fast-xml-parser@^4.4.1:
version "4.4.1"
resolved "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz#86dbf3f18edf8739326447bcaac31b4ae7f6514f"
integrity sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==
fast-xml-parser@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz#2882b7d01a6825dfdf909638f2de0256351def37"
integrity sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==
dependencies:
strnum "^1.0.5"

Expand Down

0 comments on commit 20cb849

Please sign in to comment.