Skip to content

Commit

Permalink
fix(docstring.feature): extend DocString.feature tests to cover faili…
Browse files Browse the repository at this point in the history
…ng scenario

DocString.feature will fail when ES6 template literals are present in the DocString.
  • Loading branch information
ralphpulselive committed Jul 16, 2020
1 parent fbbbc20 commit 99deab6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cypress/integration/DocString.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ Feature: Being a plugin handling DocString scenario
expect(true).to.equal(true)
variableToVerify = "hello world"
"""
Then I ran it and verify that it executes it
Then I ran it and verify that it executes it

Scenario: DocString
When I use DocString for freemarker code like this
"""
<div>
<h1>${ article.title }</h1>
</div>
"""
Then I can interpret it as a string
9 changes: 9 additions & 0 deletions cypress/support/step_definitions/docString.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ then("I ran it and verify that it executes it", () => {
eval(code);
expect(variableToVerify).to.equal("hello world");
});

let freemarkerSnippet = "";
when("I use DocString for freemarker code like this", dataString => {
freemarkerSnippet = dataString;
});

then("I can interpret it as a string", () => {
expect(freemarkerSnippet).to.be.a("string");
});

0 comments on commit 99deab6

Please sign in to comment.