Skip to content

Commit 4999f75

Browse files
committed
feat: Add test ensuring diagnostics work with packages with type module
1 parent 77359cd commit 4999f75

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

features/diagnostics.feature

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,32 @@ Feature: diagnostics
186186
- 'a step' (cypress/support/step_definitions/steps.js:2)
187187
- /a step/ (cypress/support/step_definitions/steps.js:3)
188188
"""
189+
190+
Scenario: module package
191+
Given a file named "package.json" with:
192+
"""
193+
{
194+
"type": "module"
195+
}
196+
"""
197+
And a file named "cypress/e2e/a.feature" with:
198+
"""
199+
Feature: a feature name
200+
Scenario: a scenario name
201+
Given a step
202+
"""
203+
And a file named "cypress/support/step_definitions/steps.js" with:
204+
"""
205+
const { Given } = require("@badeball/cypress-cucumber-preprocessor");
206+
Given("a step", function() {});
207+
"""
208+
When I run diagnostics
209+
Then the output should contain
210+
"""
211+
┌────────────────┬─────────────────────────────────────────────┐
212+
│ Pattern / Text │ Location │
213+
├────────────────┼─────────────────────────────────────────────┤
214+
│ 'a step' │ cypress/support/step_definitions/steps.js:2 │
215+
│ a step │ cypress/e2e/a.feature:3 │
216+
└────────────────┴─────────────────────────────────────────────┘
217+
"""

0 commit comments

Comments
 (0)