Skip to content

Commit a3ffe8c

Browse files
committed
add failing scenario
1 parent f0ef001 commit a3ffe8c

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

features/scope_proxies.feature

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Feature: Scope proxies
55
"""
66
Feature: some feature
77
Scenario: some scenario
8-
Given a step
8+
Given somebody called Lucy
99
"""
1010
And a file named "features/support/world.js" with:
1111
"""
@@ -28,11 +28,28 @@ Feature: Scope proxies
2828
Scenario: world and context can be used from appropriate scopes
2929
Given a file named "features/step_definitions/cucumber_steps.js" with:
3030
"""
31-
const {BeforeAll,Given,BeforeStep,Before,world,context} = require('@cucumber/cucumber')
31+
const {defineParameterType,BeforeAll,Given,BeforeStep,Before,world,context} = require('@cucumber/cucumber')
3232
const assert = require('node:assert/strict')
3333
34+
class Person {
35+
#name;
36+
37+
constructor(name) {
38+
this.#name = name
39+
}
40+
}
41+
42+
defineParameterType({
43+
name: 'person',
44+
regexp: /\w+/,
45+
transformer: name => {
46+
assert(world.isWorld())
47+
return new Person(name);
48+
}
49+
})
50+
3451
BeforeAll(() => assert.equal(context.parameters.a, 1))
35-
Given('a step', () => assert(world.isWorld()))
52+
Given('somebody called {person}', (person) => assert(world.isWorld()))
3653
BeforeStep(() => assert(world.isWorld()))
3754
Before(() => assert(world.isWorld()))
3855
"""

0 commit comments

Comments
 (0)