Running our scenarios

Before we implement the logic behind each step definition, let's make sure our setup is working. By default, Cucumber will look for step definitions inside a root-level features/ directory; since we placed our definitions in a different directory, we must use the --require flag to tell Cucumber where to find them.

Run npx cucumber-js spec/cucumber/features --require spec/cucumber/steps to trigger the tests:

$ npx cucumber-js spec/cucumber/features --require spec/cucumber/stepsspec/cucumber/steps/index.js:1(function (exports, require, module, __filename, __dirname) { import { Given, When, Then } from 'cucumber';                                                              ^^^^^^SyntaxError: Unexpected token import

It returns with a SyntaxError: Unexpected token import error. This ...

Get Building Enterprise JavaScript Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.