-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a payload parser to support JSON payloads
This change enabled step definitions to declare a parsed payload Given('…', (...args) => { … }, { parser: 'json' | 'json5' }) This will remove the need to JSON.parse in every step-def.
- Loading branch information
1 parent
38e5e79
commit f9f538d
Showing
6 changed files
with
122 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Feature: payload parser | ||
|
||
Scenario: happy path | ||
Then JSON representation of the payload is {"a":1,"b":2} | ||
""" | ||
{ | ||
"a": 1, | ||
"b": 2 | ||
} | ||
""" | ||
|
||
Scenario: JSON5 support | ||
Given variable A is 123 | ||
Then JSON representation of the payload is {"a":1,"b":2,"arrays":[123,"123"],"nested":{"a":1}} | ||
""" | ||
{ | ||
a: 1, | ||
b: 2, | ||
arrays: [ | ||
${A}, | ||
"${A}", | ||
], | ||
nested: { | ||
"a": 1, | ||
}, | ||
} | ||
""" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters