我正在使用 Node.js、cucumber.js(全局安装)和 Web Storm IDE 以及一个简单的加号场景,我收到以下错误。除了 callback.pending 之外,步骤定义没有其他任何内容。请问有什么想法吗?
TypeError:无法在 World 读取未定义的属性“待定”。(/Users/wfn936/Repos/customer-svc/features/step_definitions/customer.js:6:17) 在 Object.invoke (/usr/local/lib/node_modules/cucumber/lib/cucumber/support_code/step_definition.js: 88:14) 在 Object.execute (/usr/local/lib/node_modules/cucumber/lib/cucumber/ast/step.js:161:22) 在 Object.acceptVisitor (/usr/local/lib/node_modules/cucumber/ lib/cucumber/ast/step.js:147:12) 在 Object.executeStep (/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:296:12) 在 Object.processStep (/ usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:291:14)在/usr/local/lib/node_modules/cucumber/lib/cucumber/runtime/ast_tree_walker.js:129:
Feature: As a math learner
I want to add two numbers
so that I can learn how to add
Scenario:
Given I have number 3 and 5
When I add them
Then I get 8 as result
var myStepDefinitionsWrapper = function () {
this.Given(/^I have number (\d+) and (\d+)$/, function (arg1, arg2, callback) {
callback.pending();
});
this.When(/^I add them$/, function (callback) {
callback.pending();
});
this.Then(/^I get (\d+) as result$/, function (arg1, callback) {
callback.pending();
});
};
module.exports = myStepDefinitionsWrapper;