Skip to content

Commit 3caecf5

Browse files
committed
Use .feature.md extension. Update dependencies.
1 parent 9c0c509 commit 3caecf5

File tree

8 files changed

+96
-44
lines changed

8 files changed

+96
-44
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
1111

1212
### Added
1313

14+
* Experimental support for [Markdown](https://github.com/cucumber/common/blob/main/gherkin/MARKDOWN_WITH_GHERKIN.md)
15+
([#1645](https://github.com/cucumber/cucumber-js/pull/1645))
16+
1417
### Changed
1518

1619
* Clarify that the JSON formatter will not be removed any time soon

compatibility/cck_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use(chaiExclude)
2323

2424
describe('Cucumber Compatibility Kit', () => {
2525
glob.sync(`${CCK_FEATURES_PATH}/**/*.ndjson`).forEach((fixturePath) => {
26-
const match = /^.+\/(.+)(\.md|\.feature)\.ndjson$/.exec(fixturePath)
26+
const match = /^.+\/(.+)(\.feature(?:\.md)?)\.ndjson$/.exec(fixturePath)
2727
const suiteName = match[1]
2828
const extension = match[2]
2929
it(`passes the cck suite for '${suiteName}'`, async () => {
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
import assert from 'assert'
2-
import { Given } from '../../../src'
2+
import { Given, DataTable, Then, When, World } from '../../../src'
33

4-
Given('I have {int} cukes in my belly', function (cukeCount: number) {
5-
assert(cukeCount)
4+
Given('some TypeScript code:', function (dataTable: DataTable) {
5+
assert(dataTable)
6+
})
7+
8+
Given('some classic Gherkin:', function (gherkin: string) {
9+
assert(gherkin)
10+
})
11+
12+
When(
13+
'we use a data table and attach something and then {word}',
14+
async function (this: World, word: string, dataTable: DataTable) {
15+
await this.log('We are logging some plain text')
16+
assert(dataTable)
17+
if (word === 'fail') {
18+
throw new Error('You asked me to fail')
19+
}
20+
}
21+
)
22+
23+
Then('this might or might not run', function () {
24+
// no-op
625
})

features/cli.md renamed to features/cli.feature.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@ I want to run Cucumber on the command line
1818
When(/^a step is passing$/, function() {})
1919
```
2020
* When I run cucumber-js with `-r step_definitions/cucumber_steps.js`
21+
* Then it passes
22+
23+
## Scenario: run Markdown feature with non-default step definitions file location specified (-r option)
24+
25+
* Given a file named "features/a.feature.md" with:
26+
```markdown
27+
# Feature: some feature
28+
## Scenario:
29+
* When a step is passing
30+
```
31+
* And a file named "step_definitions/cucumber_steps.js" with:
32+
```javascript
33+
const {When} = require('@cucumber/cucumber')
34+
35+
When(/^a step is passing$/, function() {})
36+
```
37+
* When I run cucumber-js with `-r step_definitions/cucumber_steps.js`
38+
* Then it passes
2139

2240
## Scenario: run feature with step definitions in required directory (-r option)
2341

@@ -34,6 +52,7 @@ I want to run Cucumber on the command line
3452
When(/^a step is passing$/, function() {});
3553
```
3654
* When I run cucumber-js with `-r step_definitions`
55+
* Then it passes
3756

3857
`@spawn`
3958
# Scenario: display Cucumber version

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@
170170
"dependencies": {
171171
"@cucumber/create-meta": "^5.0.0",
172172
"@cucumber/cucumber-expressions": "^12.1.1",
173-
"@cucumber/gherkin": "^19.0.2",
173+
"@cucumber/gherkin": "^19.0.3",
174174
"@cucumber/gherkin-streams": "^2.0.2",
175175
"@cucumber/html-formatter": "^14.0.0",
176-
"@cucumber/messages": "^16.0.0",
176+
"@cucumber/messages": "^16.0.1",
177177
"@cucumber/tag-expressions": "^3.0.1",
178178
"assertion-error-formatter": "^3.0.0",
179179
"bluebird": "^3.7.2",
@@ -203,7 +203,7 @@
203203
"verror": "^1.10.0"
204204
},
205205
"devDependencies": {
206-
"@cucumber/compatibility-kit": "5.0.1",
206+
"@cucumber/compatibility-kit": "6.0.0",
207207
"@cucumber/message-streams": "2.0.0",
208208
"@cucumber/query": "10.0.0",
209209
"@sinonjs/fake-timers": "7.0.5",

src/cli/configuration_builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default class ConfigurationBuilder {
143143

144144
async expandFeaturePaths(featurePaths: string[]): Promise<string[]> {
145145
featurePaths = featurePaths.map((p) => p.replace(/(:\d+)*$/g, '')) // Strip line numbers
146-
return this.expandPaths(featurePaths, '.md')
146+
return this.expandPaths(featurePaths, '.feature')
147147
}
148148

149149
getFeatureDirectoryPaths(featurePaths: string[]): string[] {
@@ -219,6 +219,6 @@ export default class ConfigurationBuilder {
219219
return featurePaths
220220
}
221221
}
222-
return ['features/**/*.{feature,md}']
222+
return ['features/**/*.{feature,feature.md}']
223223
}
224224
}

src/cli/configuration_builder_spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('Configuration', () => {
4040
parallel: 0,
4141
pickleFilterOptions: {
4242
cwd,
43-
featurePaths: ['features/**/*.{feature,md}'],
43+
featurePaths: ['features/**/*.{feature,feature.md}'],
4444
names: [],
4545
tagExpression: '',
4646
},
@@ -91,7 +91,7 @@ describe('Configuration', () => {
9191
it('returns the appropriate .md and support code paths', async function () {
9292
// Arrange
9393
const cwd = await buildTestWorkingDirectory()
94-
const relativeFeaturePath = path.join('features', 'a.md')
94+
const relativeFeaturePath = path.join('features', 'a.feature.md')
9595
const featurePath = path.join(cwd, relativeFeaturePath)
9696
await fsExtra.outputFile(featurePath, '')
9797
const supportCodePath = path.join(cwd, 'features', 'a.js')
@@ -139,7 +139,11 @@ describe('Configuration', () => {
139139
it('returns the appropriate .md and support code paths', async function () {
140140
// Arrange
141141
const cwd = await buildTestWorkingDirectory()
142-
const relativeFeaturePath = path.join('features', 'nested', 'a.md')
142+
const relativeFeaturePath = path.join(
143+
'features',
144+
'nested',
145+
'a.feature.md'
146+
)
143147
const featurePath = path.join(cwd, relativeFeaturePath)
144148
await fsExtra.outputFile(featurePath, '')
145149
const supportCodePath = path.join(cwd, 'features', 'a.js')

yarn.lock

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@
208208
"@babel/helper-validator-identifier" "^7.14.0"
209209
to-fast-properties "^2.0.0"
210210

211-
"@cucumber/compatibility-kit@5.0.1":
212-
version "5.0.1"
213-
resolved "https://registry.yarnpkg.com/@cucumber/compatibility-kit/-/compatibility-kit-5.0.1.tgz#cf19e3d8305fb31ebaa1664e68f5685a374eda8e"
214-
integrity sha512-B5Ug+GuvKaV6Em5SsjNv12r61SYmL3yDXDX8vU9+oITVlxsuKJnDUOZwU1MNK+1c9AQM7n+cMKHfuNM4t5CopA==
211+
"@cucumber/compatibility-kit@6.0.0":
212+
version "6.0.0"
213+
resolved "https://registry.yarnpkg.com/@cucumber/compatibility-kit/-/compatibility-kit-6.0.0.tgz#c36aa033df6638450e84930015a7d5204eff9897"
214+
integrity sha512-WkjgmbgKxjIk3hhfuvbqFvW1zLjX4DoCc+Ivjxg44Nrs2zj7FIvWP2R2isGtdAMQy2FUy//vfJlt0y61Pw2EtQ==
215215

216216
"@cucumber/create-meta@^5.0.0":
217217
version "5.0.0"
@@ -238,13 +238,13 @@
238238
commander "7.2.0"
239239
source-map-support "0.5.19"
240240

241-
"@cucumber/gherkin@^19.0.1", "@cucumber/gherkin@^19.0.2":
242-
version "19.0.2"
243-
resolved "https://registry.yarnpkg.com/@cucumber/gherkin/-/gherkin-19.0.2.tgz#bb09b3239c76d1e23e40451a93e6f496706ea4fb"
244-
integrity sha512-ylhFABT04p5PIkc8bi1VBYnAaLvvoO5nGxHX9Zm8fZ3oHVTi52fE/zkDTdOZyO0uP2fjJmBP6cueL1rrYAzUfA==
241+
"@cucumber/gherkin@^19.0.1", "@cucumber/gherkin@^19.0.3":
242+
version "19.0.3"
243+
resolved "https://registry.yarnpkg.com/@cucumber/gherkin/-/gherkin-19.0.3.tgz#61036ca4940e66f8a787be5f92ce229ae3815ebf"
244+
integrity sha512-gWdMm8mfRk3P+VugJWvNALaQV5QnT+5RkqWy3tO+4NsMSQZPo5p4V4vXwriQZ/sZR1Wni5TDRztuRsKLgZ3XHA==
245245
dependencies:
246246
"@cucumber/message-streams" "^2.0.0"
247-
"@cucumber/messages" "^16.0.0"
247+
"@cucumber/messages" "^16.0.1"
248248

249249
"@cucumber/html-formatter@^14.0.0":
250250
version "14.0.0"
@@ -262,10 +262,10 @@
262262
dependencies:
263263
"@cucumber/messages" "^16.0.0"
264264

265-
"@cucumber/messages@^16.0.0":
266-
version "16.0.0"
267-
resolved "https://registry.yarnpkg.com/@cucumber/messages/-/messages-16.0.0.tgz#41c57380362b41fd507e2a3bd2a65e82021a2a8f"
268-
integrity sha512-sGYLfsR1uOZsDIjMJr89SUEvLJJgJ3uMr/9NzPBKbrL5pgoyz7xWRUj9sgk1U4+qXSflJC2C9QVTdrRedlk+Lw==
265+
"@cucumber/messages@^16.0.0", "@cucumber/messages@^16.0.1":
266+
version "16.0.1"
267+
resolved "https://registry.yarnpkg.com/@cucumber/messages/-/messages-16.0.1.tgz#8a9f9bb6ad0430d8ddd044dd49cb45ef37ee67b7"
268+
integrity sha512-80JcaAfQragFqR1rMhRwiqWL9HcR6Z4LDD2mfF0Lxg/lFkCNvmWa9Jl10NUNfFXYD555NKPzP/8xFo55abw8TQ==
269269
dependencies:
270270
"@types/uuid" "8.3.0"
271271
class-transformer "0.4.0"
@@ -349,7 +349,7 @@
349349
dependencies:
350350
type-detect "4.0.8"
351351

352-
"@sinonjs/[email protected]", "@sinonjs/fake-timers@^7.0.4":
352+
"@sinonjs/[email protected]":
353353
version "7.0.5"
354354
resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.0.5.tgz#558a7f8145a01366c44b3dcbdd7172c05c461564"
355355
integrity sha512-fUt6b15bjV/VW93UP5opNXJxdwZSbK1EdiwnhN7XrQrcpaOhMJpZ/CjwFpM3THpxwA+YviBUJKSuEqKlCK5alw==
@@ -363,6 +363,13 @@
363363
dependencies:
364364
"@sinonjs/commons" "^1.7.0"
365365

366+
"@sinonjs/fake-timers@^7.0.4":
367+
version "7.1.0"
368+
resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.0.tgz#8f13af27d842cbf51ad4502e05562fe9391d084e"
369+
integrity sha512-hAEzXi6Wbvlb67NnGMGSNOeAflLVnMa4yliPU/ty1qjgW/vAletH15/v/esJwASSIA0YlIyjnloenFbEZc9q9A==
370+
dependencies:
371+
"@sinonjs/commons" "^1.7.0"
372+
366373
"@sinonjs/samsam@^5.3.1":
367374
version "5.3.1"
368375
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-5.3.1.tgz#375a45fe6ed4e92fca2fb920e007c48232a6507f"
@@ -516,9 +523,9 @@
516523
"@types/node" "*"
517524

518525
"@types/node@*":
519-
version "15.3.0"
520-
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26"
521-
integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==
526+
version "15.6.0"
527+
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.0.tgz#f0ddca5a61e52627c9dcb771a6039d44694597bc"
528+
integrity sha512-gCYSfQpy+LYhOFTKAeE8BkyGqaxmlFxe+n4DKM6DR0wzw/HISUE/hAmkC/KT8Sw5PCJblqg062b3z9gucv3k0A==
522529

523530
524531
version "14.14.43"
@@ -777,9 +784,9 @@ ajv@^6.10.0, ajv@^6.12.4:
777784
uri-js "^4.2.2"
778785

779786
ajv@^8.0.1:
780-
version "8.4.0"
781-
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.4.0.tgz#48984fdb2ce225cab15795f0772a8d85669075e4"
782-
integrity sha512-7QD2l6+KBSLwf+7MuYocbWvRPdOu63/trReTLu2KFwkgctnub1auoF+Y1WYcm09CTM7quuscrzqmASaLHC/K4Q==
787+
version "8.5.0"
788+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.5.0.tgz#695528274bcb5afc865446aa275484049a18ae4b"
789+
integrity sha512-Y2l399Tt1AguU3BPRP9Fn4eN+Or+StUGWCUpbnFyXSo8NZ9S4uj+AG2pjs5apK+ZMOwYOz1+a+VKvKH7CudXgQ==
783790
dependencies:
784791
fast-deep-equal "^3.1.1"
785792
json-schema-traverse "^1.0.0"
@@ -1576,9 +1583,9 @@ [email protected]:
15761583
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
15771584

15781585
electron-to-chromium@^1.3.723:
1579-
version "1.3.732"
1580-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.732.tgz#2a07a8d61f74f2084b6f6bf2a908605a7a0b2d8d"
1581-
integrity sha512-qKD5Pbq+QMk4nea4lMuncUMhpEiQwaJyCW7MrvissnRcBDENhVfDmAqQYRQ3X525oTzhar9Zh1cK0L2d1UKYcw==
1586+
version "1.3.736"
1587+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz#f632d900a1f788dab22fec9c62ec5c9c8f0c4052"
1588+
integrity sha512-DY8dA7gR51MSo66DqitEQoUMQ0Z+A2DSXFi7tK304bdTVqczCAfUuyQw6Wdg8hIoo5zIxkU1L24RQtUce1Ioig==
15821589

15831590
emoji-regex@^7.0.1:
15841591
version "7.0.3"
@@ -3206,9 +3213,9 @@ normalize-path@^3.0.0, normalize-path@~3.0.0:
32063213
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
32073214

32083215
normalize-url@^4.1.0:
3209-
version "4.5.0"
3210-
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129"
3211-
integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==
3216+
version "4.5.1"
3217+
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
3218+
integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==
32123219

32133220
32143221
version "15.1.0"
@@ -3479,9 +3486,9 @@ pathval@^1.1.1:
34793486
integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==
34803487

34813488
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
3482-
version "2.2.3"
3483-
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d"
3484-
integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==
3489+
version "2.3.0"
3490+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
3491+
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
34853492

34863493
pify@^2.0.0:
34873494
version "2.3.0"
@@ -3981,9 +3988,9 @@ spdx-expression-parse@^3.0.0:
39813988
spdx-license-ids "^3.0.0"
39823989

39833990
spdx-license-ids@^3.0.0:
3984-
version "3.0.8"
3985-
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.8.tgz#eb1e97ad99b11bf3f82a3b71a0472dd9a00f2ecf"
3986-
integrity sha512-NDgA96EnaLSvtbM7trJj+t1LUR3pirkDCcz9nOUlPb5DMBGsH7oES6C3hs3j7R9oHEa1EMvReS/BUAIT5Tcr0g==
3991+
version "3.0.9"
3992+
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz#8a595135def9592bda69709474f1cbeea7c2467f"
3993+
integrity sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==
39873994

39883995
sprintf-js@~1.0.2:
39893996
version "1.0.3"

0 commit comments

Comments
 (0)