Skip to content

Commit 4d36090

Browse files
fixed issue with $' replacement (#26)
* fixed issue with $' replacement
1 parent 8e20782 commit 4d36090

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.0.11
2+
- fixed $' replace issue
3+
14
# 0.0.10
25
- fixed issue of not escaped chars in logs
36

formatter/formatter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class HTMLFormatter extends JsonFormatter {
1010
this.log = function(json) {
1111
const htmlTemplate = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf-8');
1212
log(htmlTemplate
13-
.replace('METADATA', JSON.stringify(this.metadata, null, 0))
14-
.replace('SOURCE_DATA', JSON.stringify(JSON.parse(json), null, 0)));
13+
.replace('METADATA', () => JSON.stringify(this.metadata, null, 0))
14+
.replace('SOURCE_DATA', () => JSON.stringify(JSON.parse(json), null, 0)));
1515
}
1616
}
1717

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/html-formatter",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"main": "formatter/formatter.js",
55
"scripts": {
66
"report:compile": "node test/compile_report.js",

test/features/Logs.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ Feature: Logs
55

66
Scenario: scenario failed with logs
77
And failed step with log
8+
9+
Scenario: scenario dollar replace
10+
And I expect 'some string' to match '^120$'

test/step_definitions/custom_steps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ When('failed step with log', function () {
6060
throw new Error('failed step');
6161
});
6262

63+
When(`I expect {string} to match {string}`, async function (one, two) {});
64+

0 commit comments

Comments
 (0)