-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathloaders.feature
59 lines (51 loc) · 1.48 KB
/
loaders.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
@esm
Feature: ESM loaders support
I want to nominate one or more loaders to use to transpile my code
So that I can write my source code in another language
As a user
Background:
Given a file named "features/a.feature" with:
"""
Feature: some feature
Scenario: some scenario
Given a passing step
"""
And a file named "features/steps.ts" with:
"""
import { Given } from '@cucumber/cucumber'
interface Something {
field1: string
field2: string
}
Given('a passing step', () => {})
"""
And a file named "tsconfig.json" with:
"""
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "nodenext"
}
}
"""
Scenario: serial runtime
When I run cucumber-js with `--loader ts-node/esm --import features/steps.ts`
Then it passes
Scenario: parallel runtime
When I run cucumber-js with `--loader ts-node/esm --import features/steps.ts --parallel 1`
Then it passes
Scenario: local loader
Given a file named "custom-loader.mjs" with:
"""
// no-op loader hook
export async function load(url, context, nextLoad) {
return nextLoad(url);
}
"""
Given a file named "features/steps.mjs" with:
"""
import { Given } from '@cucumber/cucumber'
Given('a passing step', () => {})
"""
When I run cucumber-js with `--loader ./custom-loader.mjs`
Then it passes