diff --git a/CHANGELOG.MD b/CHANGELOG.MD index bed4ebb..c1e5ea4 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,3 +1,6 @@ +# 0.0.11 +- fixed $' replace issue + # 0.0.10 - fixed issue of not escaped chars in logs diff --git a/formatter/formatter.js b/formatter/formatter.js index 0dbd59b..d84810c 100644 --- a/formatter/formatter.js +++ b/formatter/formatter.js @@ -10,8 +10,8 @@ class HTMLFormatter extends JsonFormatter { this.log = function(json) { const htmlTemplate = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf-8'); log(htmlTemplate - .replace('METADATA', JSON.stringify(this.metadata, null, 0)) - .replace('SOURCE_DATA', JSON.stringify(JSON.parse(json), null, 0))); + .replace('METADATA', () => JSON.stringify(this.metadata, null, 0)) + .replace('SOURCE_DATA', () => JSON.stringify(JSON.parse(json), null, 0))); } } diff --git a/package-lock.json b/package-lock.json index 62509da..a1c4250 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@qavajs/html-formatter", - "version": "0.0.10", + "version": "0.0.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@qavajs/html-formatter", - "version": "0.0.10", + "version": "0.0.11", "devDependencies": { "@babel/core": "^7.21.0", "@cucumber/cucumber": "^9.1.0", diff --git a/package.json b/package.json index 13f2365..92e0de3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@qavajs/html-formatter", - "version": "0.0.10", + "version": "0.0.11", "main": "formatter/formatter.js", "scripts": { "report:compile": "node test/compile_report.js", diff --git a/test/features/Logs.feature b/test/features/Logs.feature index 79c50eb..41beed2 100644 --- a/test/features/Logs.feature +++ b/test/features/Logs.feature @@ -5,3 +5,6 @@ Feature: Logs Scenario: scenario failed with logs And failed step with log + + Scenario: scenario dollar replace + And I expect 'some string' to match '^120$' diff --git a/test/step_definitions/custom_steps.ts b/test/step_definitions/custom_steps.ts index 3e1830d..3f8689b 100644 --- a/test/step_definitions/custom_steps.ts +++ b/test/step_definitions/custom_steps.ts @@ -60,3 +60,5 @@ When('failed step with log', function () { throw new Error('failed step'); }); +When(`I expect {string} to match {string}`, async function (one, two) {}); +