Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 2b00bac

Browse files
committed
Remove cucumber.json altogether
* Start and configure processes in with NODE_ENV in package.json * Remove obsolete step definitions
1 parent 36069fd commit 2b00bac

File tree

6 files changed

+5
-24
lines changed

6 files changed

+5
-24
lines changed

config/cucumber.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

features/api/post.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Feature: Import a post from an organization and publish it in Human Connection
55

66

77
Background:
8-
Given the Human Connection API is up and running
9-
And there is a user in Human Connection with these credentials:
8+
Given there is a user in Human Connection with these credentials:
109
| email | password |
1110
| user@example.com | 1234 |
1211

features/api/usersettings.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Feature: Save current newsfeed filters to usersettings
44
In order to see the same selection of content next time I log in
55

66
Background:
7-
Given the Human Connection API is up and running
8-
And there is a user in Human Connection with these credentials:
7+
Given there is a user in Human Connection with these credentials:
98
| email | password | isVerified |
109
| user@example.com | 1234 | true |
1110

features/env/database.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint no-console: off */
22
const { Before, AfterAll, setWorldConstructor } = require('cucumber');
33

4-
process.env.NODE_ENV = 'test'; // write into the test database
54
const backendApp = require('../../server/app');
65

76
function CustomWorld() {

features/step_definitions/steps.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const fetch = require('node-fetch');
66
const { expect } = require('chai');
77
const waitOn = require('wait-on');
88

9-
const hcBackendUrl = 'http://localhost:3030';
9+
const hcBackendUrl = 'http://localhost:3031';
1010

1111
let currentUser;
1212
let currentUserPassword;
@@ -50,17 +50,6 @@ function postRequest(route, body, callback) {
5050
});
5151
}
5252

53-
Given(/^the Human Connection API is up and running(?: on "http:\/\/localhost:3030")?/, (callback) => {
54-
waitOn({ resources: ['tcp:3030'], timeout: 30000 }, (err) => {
55-
if (err) throw (err);
56-
return callback();
57-
});
58-
});
59-
60-
Given('there is a 3rd party application running, e.g. \'Democracy\'', () => {
61-
// Just documentation
62-
});
63-
6453
Given('there is a user in Human Connection with these credentials:', function (dataTable) {
6554
const params = dataTable.hashes()[0];
6655
currentUserPassword = params.password;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"dev:win": "npm run clear && concurrently \"mongod --dbpath /data/db\" \"wait-on tcp:27017&&cross-env NODE_ENV=development&&cross-env DEBUG=feathers&& nodemon --inspect server/\"",
4747
"mocha": "npm run clear && $npm_package_config_mocha",
4848
"mocha:mongo": "$npm_package_config_concurrently '$npm_package_config_mongoDev &>/dev/null' 'wait-on tcp:27017 && npm run mocha'",
49-
"cucumber": "npm run clear && concurrently --kill-others --success first 'cross-env NODE_ENV=test node server/' 'wait-on tcp:3030 && cross-env NODE_ENV=test cucumber-js'",
50-
"cucumber:mongo": "npm run clear && concurrently --kill-others --success first '$npm_package_config_mongoDev &>/dev/null || sleep infinity' 'wait-on tcp:27017 && cross-env NODE_ENV=test node server/' 'wait-on tcp:3030 && cross-env NODE_ENV=test cucumber-js'"
49+
"cucumber": "npm run clear && concurrently --kill-others --success first 'cross-env NODE_ENV=test node server/' 'wait-on tcp:3031 && cross-env NODE_ENV=test cucumber-js'",
50+
"cucumber:mongo": "npm run clear && concurrently --kill-others --success first '$npm_package_config_mongoDev &>/dev/null || sleep infinity' 'wait-on tcp:27017 && cross-env NODE_ENV=test node server/' 'wait-on tcp:3031 && cross-env NODE_ENV=test cucumber-js'"
5151
},
5252
"config": {
5353
"mongoDev": "mongod --dbpath data --quiet",

0 commit comments

Comments
 (0)