Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not using defineSupportCode in installation examples anymore #35

Closed
lelbil opened this issue Oct 6, 2018 · 1 comment · Fixed by #36
Closed

Not using defineSupportCode in installation examples anymore #35

lelbil opened this issue Oct 6, 2018 · 1 comment · Fixed by #36

Comments

@lelbil
Copy link

lelbil commented Oct 6, 2018

Do you want to request a feature or report a bug?
More of a Readme update.

What is the current behavior?
The readme has some installation examples, they all have defineSupportCode, a function that was deprecated in cucumber in version 4.0.0 (Cucumber Changelog)

If the current behavior is a bug, please provide the steps to reproduce.
When running tests with a cucumber >= 4.0.0, we get a warning message: DeprecationWarning: cucumber: defineSupportCode is deprecated. Please require/import the individual methods instead.

What is the expected behavior?
Rewrite the readme installation examples without using the deprecated method.

An example might be:

const { setWorldConstructor, Given, Then, When, Before } = require('cucumber')
const { state, fixtures, httpApi, cli } = require('@ekino/veggies')
const fixturesHooks = require('@ekino/veggies/src/extensions/fixtures/hooks')
const stateDefinitions = require('@ekino/veggies/src/extensions/state/definitions')
const httpApiDefinitions = require('@ekino/veggies/src/extensions/http_api/definitions')
const cliDefinitions = require('@ekino/veggies/src/extensions/cli/definitions')

setWorldConstructor(function() {
    state.extendWorld(this)
    fixtures.extendWorld(this)
    httpApi.extendWorld(this)
    cli.extendWorld(this)
})

stateDefinitions({Given, When})
fixturesHooks({Before})
httpApiDefinitions({ baseUrl: 'http://localhost:3000' })({Given, Then, When})
cliDefinitions({Given, Then, When})

Also, the required parts of veggies (i.e the definitions for each extension, the hooks for fixtures or the step definitions.. for example) can be exposed through the extension itself to have less requires and be able to use them directly like this: state.defintions({Given, When})

What do you think?

Please provide your exact configuration and mention your veggies, node, yarn/npm version and operating system.
I am using an official node image with latest tag
OS: Linux
Node: v10.6.0
NPM: 6.1.0
Veggies: 0.6.0
Cucumber: 5.0.1

@leguellec leguellec linked a pull request Dec 16, 2020 that will close this issue
@leguellec
Copy link
Contributor

Resolved by #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants