-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
esm.feature
63 lines (56 loc) · 1.72 KB
/
esm.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@esm
Feature: ES modules support
cucumber-js works with native ES modules
Scenario Outline: native module syntax works in support code, formatters and snippets
Given a file named "features/a.feature" with:
"""
Feature:
Scenario: one
Given a step passes
Scenario: two
Given a step passes
"""
And a file named "features/step_definitions/cucumber_steps.js" with:
"""
import {Given} from '@cucumber/cucumber'
Given(/^a step passes$/, function() {});
"""
And a file named "custom-formatter.js" with:
"""
import {SummaryFormatter} from '@cucumber/cucumber'
export default class CustomFormatter extends SummaryFormatter {}
"""
And a file named "custom-snippet-syntax.js" with:
"""
export default class CustomSnippetSyntax {
build(opts) {
return 'hello world'
}
}
"""
And a file named "cucumber.cjs" with:
"""
module.exports = {
'default': '--format summary'
}
"""
When I run cucumber-js with `<options> --format ./custom-formatter.js --format-options '{"snippetSyntax": "./custom-snippet-syntax.js"}' <args>`
Then it passes
Examples:
| args |
| |
| --parallel 2 |
Scenario: .mjs support code files are matched by default
Given a file named "features/a.feature" with:
"""
Feature:
Scenario:
Given a step passes
"""
And a file named "features/step_definitions/cucumber_steps.mjs" with:
"""
import {Given} from '@cucumber/cucumber'
Given(/^a step passes$/, function() {});
"""
When I run cucumber-js
Then it passes