Giter Club home page Giter Club logo

cucumber6-ts-starter's People

Contributors

hdorgeval avatar vitorduarte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cucumber6-ts-starter's Issues

Is there a custom world constructor?

Hello,

Can you add a custom world constructor to this project? I have a class that extends World but all of the class properties are undefined when I try to access them in a step.

Adding an additional source directory leads to error

The issue is that, at least when running zsh on macOS, if you add additional source directories to the project, the wildcards in the cucumber-js command line are expanded, leading the cucumber interpreter to believe that the additional source files are actually feature files.

For example, as a part of transitioning to my own project, I added an additional directory under domains, and added .ts files into that directory:

domains/simple-maths
domains/simple-maths/simple-maths-calculator.ts
domains/chinsay
domains/chinsay/workspace.ts

Although npm run build reported no errors, running npm test reported errors like:

tardis (cjn) ~/src/Chinsay/cucumber-ts-starter ± ./node_modules/.bin/cucumber-js features/**/*.feature --logLevel=verbose --require build/**/*.js --require step-definitions/**/*.ts --require hooks/**/*.ts  --require-module ts-node/register --format-options '{"snippetInterface": "async-await"}' --format json:reports/cucumber-report.json --format summary
Error: (1:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got '"use strict";'
    at /Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/cucumber/src/cli/helpers.js:63:13
    at Array.forEach (<anonymous>)
    at /Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/cucumber/src/cli/helpers.js:51:10
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/generators.js:97:49)
    at /Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/generators.js:201:15
    at getTestCases (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/cucumber/lib/cli/helpers.js:96:18)
    at /Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/cucumber/src/cli/helpers.js:30:13
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/generators.js:97:49)
    at Promise._settlePromise (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/promise.js:574:26)
    at Promise._settlePromise0 (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/Users/cjn/src/Chinsay/cucumber-ts-starter/node_modules/bluebird/js/release/async.js:133:16)
[1]    94694 exit 1     ./node_modules/.bin/cucumber-js features/**/*.feature --logLevel=verbose     

The fix is straightforward: add quotes around the paths, so that cucumber itself performs the wildcard expansion, i.e. in package.json, replace

"cucumber": "./node_modules/.bin/cucumber-js features/**/*.feature --logLevel=error --require step-definitions/**/*.ts --require hooks/**/*.ts --require-module ts-node/register --format-options '{\"snippetInterface\": \"async-await\"}' --format json:reports/cucumber-report.json --format summary",

with:

"cucumber": "./node_modules/.bin/cucumber-js features/**/*.feature --logLevel=error --require 'step-definitions/**/*.ts' --require 'hooks/**/*.ts' --require-module ts-node/register --format-options '{\"snippetInterface\": \"async-await\"}' --format json:reports/cucumber-report.json --format summary",

Pull request coming.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.