If you're reading an electronic version of this book, be careful copying and pasting sections, as you may lose formatting. Cucumber feature files are sensitive to indenting. The default indent is two spaces at each level.
We'll learn about Cucumber as we walk through an example:
- Before we begin, it's important to ensure that your build output is up to date. Your Cucumber specs are going to run against the code built in the dist directory, not your source in the src directory. Invoke npm run build to make sure that happens. You'll need to remember to do this each time you modify your source files.
You could also modify your package.json to invoke a build before Cucumber specs are run, or to run Webpack in watch mode. See the Further learning section for a link.
- Open the file features/sharing.feature and enter the following...