Skip to content

Commit

Permalink
build: run cucumber tests using NPM scripts instead of Grunt
Browse files Browse the repository at this point in the history
The main reason for this change is to be able to update Cucumber library as `grunt-cucumberjs` (mavdi/grunt-cucumberjs#110) does not support cucumber@4 and looks pretty abandoned.

Grunt ecosystem is not very active for a while, so we can expect more issues of this sort in the future. Because of this and to keep docs consistent I've also added NPM scripts to run other test types (for now they just proxy to Grunt) and removed Grunt examples from the documentation.

In the next PR I will update `cucumber` and perform some cleanup of the step definitions.
  • Loading branch information
devoto13 committed Apr 19, 2020
1 parent 39648b5 commit 7f2e8a9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 257 deletions.
14 changes: 14 additions & 0 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Shared configuration for Cucumber.js tests.
// See https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md#profiles
const options = [
'--format progress',
'--require test/e2e/support/env.js',
'--require test/e2e/support/world.js',
'--require test/e2e/step_definitions/core_steps.js',
'--require test/e2e/step_definitions/hooks.js',
'--tags "not @not-jenkins"'
]

module.exports = {
'default': options.join(' ')
}
24 changes: 12 additions & 12 deletions docs/dev/02-making-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ Here are some tips on how to set up a Karma workspace and how to send a good pul
* Install for development. Use a recent npm version, ignore peerdep warnings
```bash
$ npm install
$ rm -rf node_modules/karma
$ cd node_modules
$ ln -s ../ karma
$ cd ../
$ grunt browserify

$ npm run init
# or if you're on Windows
$ npm run init:windows

$ npm build
```

## Testing and Building
- Run the tests via:
```bash
$ npm test
# or if you have grunt-cli installed globally you can also
$ grunt test:unit
$ grunt test:e2e
$ grunt test:client

# All tests.
$ grunt test
# or you can run test suits individually
$ npm run test:unit
$ npm run test:e2e
$ npm run test:client
```

- Lint the code via:
```bash
$ npm run lint
# or you can also apply auto-fixes where possible
$ npm run lint:fix
```

- Build the client code via:
Expand Down
27 changes: 1 addition & 26 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ module.exports = function (grunt) {
},
test: {
unit: 'mochaTest:unit',
client: 'test/client/karma.conf.js',
e2e: 'cucumberjs:ci'
client: 'test/client/karma.conf.js'
},
watch: {
client: {
Expand All @@ -43,30 +42,6 @@ module.exports = function (grunt) {
]
}
},
cucumberjs: {
options: {
steps: 'test/e2e/step_definitions',
format: 'progress',
require: ['test/e2e/support/env.js', 'test/e2e/support/world.js']
},
all: 'test/e2e/*.feature',
current: {
files: {
src: 'test/e2e/*.feature'
},
options: {
tags: '@current'
}
},
ci: {
files: {
src: 'test/e2e/*.feature'
},
options: {
tags: 'not @not-jenkins'
}
}
},
eslint: {
options: {
quiet: true
Expand Down
Loading

0 comments on commit 7f2e8a9

Please sign in to comment.