Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit ad30890

Browse files
fix: removes arrow functions to prevent context binding of Cucumber steps
1 parent 89e7d08 commit ad30890

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = function() {
2-
this.Given(
3-
/^you expect HTTP message method "([^"]*)"$/,
4-
(method, callback) => {
5-
this.expected.method = method;
6-
return callback();
7-
}
8-
);
2+
this.Given(/^you expect HTTP message method "([^"]*)"$/, function(
3+
method,
4+
callback
5+
) {
6+
this.expected.method = method;
7+
return callback();
8+
});
99

10-
return this.When(
11-
/^real HTTP message method is "([^"]*)"$/,
12-
(method, callback) => {
13-
this.real.message = method;
14-
return callback();
15-
}
16-
);
10+
return this.When(/^real HTTP message method is "([^"]*)"$/, function(
11+
method,
12+
callback
13+
) {
14+
this.real.method = method;
15+
return callback();
16+
});
1717
};

test/cucumber/step_definitions/uri_steps.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
module.exports = function() {
2-
this.Given(/^you expect HTTP message URI "([^"]*)"$/, (uri, callback) => {
2+
this.Given(/^you expect HTTP message URI "([^"]*)"$/, function(
3+
uri,
4+
callback
5+
) {
36
this.expected.uri = uri;
47
return callback();
58
});
69

7-
return this.When(/^real HTTP message URI is "([^"]*)"$/, (uri, callback) => {
10+
return this.When(/^real HTTP message URI is "([^"]*)"$/, function(
11+
uri,
12+
callback
13+
) {
814
this.real.uri = uri;
915
return callback();
1016
});

0 commit comments

Comments
 (0)