Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bnadim committed Nov 21, 2018
1 parent febc947 commit 23f5d3b
Show file tree
Hide file tree
Showing 17 changed files with 3,946 additions and 1,649 deletions.
12 changes: 12 additions & 0 deletions .commitlintrc.yml
@@ -0,0 +1,12 @@
rules:
type-enum:
- 2
- always
- ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore", "revert"]
subject-empty:
- 2
- never
subject-max-length:
- 2
- always
- 80
3 changes: 3 additions & 0 deletions .huskyrc
@@ -0,0 +1,3 @@
hooks:
pre-commit: lint-staged
commit-msg: commitlint -E HUSKY_GIT_PARAMS
12 changes: 12 additions & 0 deletions .lintstagedrc
@@ -0,0 +1,12 @@
README.tpl.md:
- readme
- git add

"*.feature":
- cucumberjs --require examples/support examples/features --tags @offline

"*.js":
- yarn lint-fix
- yarn fmt
- git add
- jest --bail --findRelatedTests
3 changes: 2 additions & 1 deletion .travis.yml
@@ -1,8 +1,9 @@
language: node_js
node_js:
- '6'
- '7'
- '8'
- '10'
- '11'
env:
- CUMCUMBER_VERSION=2.x.x
- CUMCUMBER_VERSION=3.x.x
Expand Down
104 changes: 28 additions & 76 deletions package.json
Expand Up @@ -28,34 +28,34 @@
},
"engineStrict": true,
"dependencies": {
"chai": "^4.0.2",
"fs-extra": "^4.0.0",
"glob": "^7.1.2",
"jest-diff": "^21.0.0",
"js-yaml": "^3.8.4",
"lodash": "^4.17.4",
"natural-compare": "^1.4.0",
"pretty-format": "^21.0.2",
"request": "^2.81.0",
"tough-cookie": "^2.3.2"
"chai": "4.2",
"fs-extra": "7.0",
"glob": "7.1",
"jest-diff": "23.6",
"js-yaml": "3.12",
"lodash": "4.17",
"natural-compare": "1.4",
"pretty-format": "23.6",
"request": "2.88",
"tough-cookie": "2.4"
},
"devDependencies": {
"babylon": "^6.17.4",
"chalk": "^2.0.1",
"coveralls": "^2.13.1",
"cucumber": "3.x.x",
"eslint": "^4.1.1",
"gh-pages": "^1.0.0",
"git-changelog": "^1.1.2",
"husky": "^0.14.3",
"jest": "^20.0.4",
"jsdoc": "^3.4.3",
"lint-staged": "^4.0.1",
"minami": "^1.2.3",
"mustache": "^2.3.0",
"nock": "^9.0.13",
"prettier": "^1.5.2",
"validate-commit-msg": "^2.12.2"
"babylon": "6.x",
"chalk": "2.x",
"commitlint": "7.x",
"coveralls": "3.x",
"cucumber": "5.x",
"eslint": "5.x",
"gh-pages": "2.x",
"git-changelog": "1.x",
"husky": "1.x",
"jest": "23.x",
"jsdoc": "3.x",
"lint-staged": "8.x",
"minami": "1.x",
"mustache": "3.x",
"nock": "10.x",
"prettier": "1.x"
},
"peerDependencies": {
"cucumber": ">=2.3.1 <4.0.0"
Expand All @@ -72,55 +72,7 @@
"readme": "node scripts/generate_readme",
"doc": "jsdoc src -R README.md -r -d _doc --verbose -t node_modules/minami",
"doc-pub": "yarn run readme && yarn run doc && gh-pages -d _doc",
"examples": "cucumberjs --require examples/support examples/features",
"changelog": "git-changelog -t false -n v${npm_package_version}",
"precommit": "lint-staged",
"commitmsg": "validate-commit-msg"
},
"lint-staged": {
"README.tpl.md": [
"readme",
"git add"
],
"*.feature": [
"cucumberjs --require examples/support examples/features --tags @offline"
],
"*.js": [
"lint-fix",
"fmt",
"git add",
"jest --bail --findRelatedTests"
]
},
"config": {
"validate-commit-msg": {
"types": [
"feat",
"fix",
"docs",
"style",
"refactor",
"perf",
"test",
"build",
"ci",
"chore",
"revert"
],
"scope": {
"required": false,
"allowed": [
"*"
],
"validate": false,
"multiple": false
},
"warnOnFail": false,
"maxSubjectLength": 80,
"subjectPattern": ".+",
"subjectPatternErrorMsg": "subject does not match subject pattern!",
"helpMessage": "",
"autoFix": false
}
"examples": "cucumber-js --require examples/support examples/features",
"changelog": "git-changelog -t false -n v${npm_package_version}"
}
}
7 changes: 6 additions & 1 deletion src/core/cast.js
Expand Up @@ -59,7 +59,12 @@ castFunctions['boolean'] = value => {
* @return {Array}
*/
castFunctions['array'] = value => {
return value ? value.replace(/\s/g, '').split(',').map(exports.value) : []
return value
? value
.replace(/\s/g, '')
.split(',')
.map(exports.value)
: []
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/cli/cli.js
Expand Up @@ -186,9 +186,9 @@ class Cli {

return reject(
new Error(
`process.kill('${this
.killSignal}') scheduled but process exited (delay: ${this
.killDelay}ms)`
`process.kill('${
this.killSignal
}') scheduled but process exited (delay: ${this.killDelay}ms)`
)
)
}
Expand Down
10 changes: 5 additions & 5 deletions src/extensions/file_system/definitions.js
Expand Up @@ -49,11 +49,11 @@ module.exports = ({ Given, Then }) => {
.then(content => {
let expectFn = expect(
content,
`Expected file '${file}' to ${flag
? flag
: ''}${comparator} '${expectedValue}', but found '${content}' which does${flag
? ''
: ' not'}`
`Expected file '${file}' to ${
flag ? flag : ''
}${comparator} '${expectedValue}', but found '${content}' which does${
flag ? '' : ' not'
}`
).to
if (flag !== undefined) {
expectFn = expectFn.not
Expand Down
10 changes: 5 additions & 5 deletions src/extensions/http_api/definitions.js
Expand Up @@ -352,11 +352,11 @@ module.exports = ({ baseUrl = '' } = {}) => ({ Given, When, Then }) => {

let expectFn = expect(
header,
`Expected header '${key}' to ${flag
? flag
: ''}${comparator} '${expectedValue}', but found '${header}' which does${flag
? ''
: ' not'}`
`Expected header '${key}' to ${
flag ? flag : ''
}${comparator} '${expectedValue}', but found '${header}' which does${
flag ? '' : ' not'
}`
).to
if (flag !== undefined) {
expectFn = expectFn.not
Expand Down
5 changes: 3 additions & 2 deletions src/extensions/snapshot/extension.js
Expand Up @@ -56,8 +56,9 @@ class Snapshot {

if (!snapshotsPrefix)
throw new Error(
`Can not do a snapshot. Scenario not found in file ${this
.featureFile} on line ${this.scenarioLine}`
`Can not do a snapshot. Scenario not found in file ${this.featureFile} on line ${
this.scenarioLine
}`
)

this._snapshotsCount += 1
Expand Down
20 changes: 10 additions & 10 deletions src/extensions/state/state.js
Expand Up @@ -21,21 +21,21 @@ class State {
}

/**
* Sets value for given key.
*
* @param {string} key - The key you wish to set a value for
* @param {*} value - The value
*/
* Sets value for given key.
*
* @param {string} key - The key you wish to set a value for
* @param {*} value - The value
*/
set(key, value) {
return _.set(this.state, key, value)
}

/**
* Retrieves a value for given key.
*
* @param {string} key - The key you wish to retrieve a value for
* @return {*}
*/
* Retrieves a value for given key.
*
* @param {string} key - The key you wish to retrieve a value for
* @return {*}
*/
get(key) {
return _.get(this.state, key)
}
Expand Down
4 changes: 3 additions & 1 deletion tests/extensions/definitions_helper.js
Expand Up @@ -96,7 +96,9 @@ exports.define = definitions => {

if (found.length > 1) {
throw new TypeError(
`Pattern '${pattern}' is ambiguous, found ${found.length} definitions:\n - ${found
`Pattern '${pattern}' is ambiguous, found ${
found.length
} definitions:\n - ${found
.map(({ matcher }) => matcher.toString())
.join('\n - ')}`
)
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/http_api/definitions.test.js
Expand Up @@ -165,7 +165,7 @@ test('set request multipart body from', () => {

const fixture = {
id: '2',
file: fs.ReadStream('path/to/file', {})
file: fs.createReadStream('path/to/file', {})
}
const worldMock = {
httpApiClient: { setMultipartBody: jest.fn() },
Expand Down
8 changes: 4 additions & 4 deletions tests/extensions/snapshot/cmd.test.js
Expand Up @@ -39,7 +39,7 @@ afterEach(function() {
})

test('Snapshot should report created snapshots', () => {
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumberjs')
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumber-js')
let command = `${cucumberBin} --color --require cucumber_test/support cucumber_test/features`
const cwd = __dirname

Expand All @@ -59,7 +59,7 @@ test('Snapshot should report created snapshots', () => {
})

test('Snapshot module report updated snapshots and support the -u option', () => {
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumberjs')
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumber-js')
let command = `${cucumberBin} --color -u --require cucumber_test/support cucumber_test/features`
const cwd = __dirname

Expand All @@ -79,7 +79,7 @@ test('Snapshot module report updated snapshots and support the -u option', () =>
})

test('Snapshot module report removed snapshots and support --cleanSnapshots option', () => {
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumberjs')
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumber-js')
let command = `${cucumberBin} --color --cleanSnapshots --require cucumber_test/support cucumber_test/features`
const cwd = __dirname

Expand All @@ -99,7 +99,7 @@ test('Snapshot module report removed snapshots and support --cleanSnapshots opti
})

test('Snapshot module report created, updated and removed snapshots and support the --updateSnapshots option', () => {
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumberjs')
const cucumberBin = path.join(process.cwd(), './node_modules/.bin/cucumber-js')
let command = `${cucumberBin} --color --cleanSnapshots --updateSnapshots --require cucumber_test/support cucumber_test/features`
const cwd = __dirname

Expand Down
Expand Up @@ -5,6 +5,8 @@ const { defineSupportCode } = require('cucumber')

defineSupportCode(({ Given }) => {
Given(/^I mock http call to forward request body for path (.+)$/, function(path) {
nock('http://fake.io').post(path).reply(200, (uri, requestBody) => requestBody)
nock('http://fake.io')
.post(path)
.reply(200, (uri, requestBody) => requestBody)
})
})
2 changes: 1 addition & 1 deletion tests/extensions/snapshot/snapshot.test.js
Expand Up @@ -112,7 +112,7 @@ test('diff should show multiples diff', () => {
\u001b[31m+ "key4": "value7",\u001b[39m
\u001b[2m "key5": "value5",\u001b[22m
\u001b[2m }\u001b[22m
\u001b[2m \u001b[22m
\u001b[2m \u001b[43m \u001b[49m\u001b[22m
"""
`

Expand Down

0 comments on commit 23f5d3b

Please sign in to comment.