Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions compatibility/cck_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ const CCK_FEATURES_PATH = 'node_modules/@cucumber/compatibility-kit/features'
const CCK_IMPLEMENTATIONS_PATH = 'compatibility/features'

const UNSUPPORTED = [
// we aren't fully compliant yet for global hooks
'global-hooks-attachments',
'global-hooks-beforeall-error',
'global-hooks-afterall-error',
// not a test sample
'test-run-exception',
// suggestions not implemented yet
'examples-tables-undefined',
'hooks-undefined',
'retry-undefined',
'undefined',
'unknown-parameter-type',
]

config.truncateThreshold = 100
Expand Down
4 changes: 2 additions & 2 deletions compatibility/features/ambiguous/ambiguous.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Given } from '../../../src'

Given(/a (.*?) with (.*?)/, function () {
Given(/^a (.*?) with (.*?)$/, function () {
// first one
})

Given(/a step with (.*)/, function () {
Given(/^a step with (.*)$/, function () {
// second one
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import assert from 'node:assert'
import { Given, When, Then } from '../../../src'

Given('there are {int} cucumbers', function (initialCount) {
this.count = initialCount
})

When('I eat {int} cucumbers', function (eatCount) {
this.count -= eatCount
})

Then('I should have {int} cucumbers', function (expectedCount) {
assert.strictEqual(this.count, expectedCount)
})
33 changes: 33 additions & 0 deletions compatibility/features/hooks-skipped/hooks-skipped.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { After, Before, When } from '../../../src'

Before({}, function () {
// no-op
})

Before({ tags: '@skip-before' }, function () {
return 'skipped'
})

Before({}, function () {
// no-op
})

When('a normal step', function () {
// no-op
})

When('a step that skips', function () {
return 'skipped'
})

After({}, function () {
// no-op
})

After({ tags: '@skip-after' }, function () {
return 'skipped'
})

After({}, function () {
// no-op
})
9 changes: 9 additions & 0 deletions compatibility/features/hooks-undefined/hooks-undefined.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Before, After } from '../../../src'

Before({}, () => {
// no-op
})

After({}, () => {
// no-op
})
9 changes: 9 additions & 0 deletions compatibility/features/retry-ambiguous/retry-ambiguous.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Given } from '../../../src'

Given('an ambiguous step', function () {
// first one
})

Given('an ambiguous step', function () {
// second one
})
5 changes: 5 additions & 0 deletions compatibility/features/retry-pending/retry-pending.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Given } from '../../../src'

Given('a pending step', function () {
return 'pending'
})
1 change: 1 addition & 0 deletions compatibility/features/retry-undefined/retry-undefined.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// There are intentionally no steps defined for this sample
12 changes: 0 additions & 12 deletions compatibility/features/retry/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,3 @@ Given('a step that passes the third time', function () {
Given('a step that always fails', function () {
throw new Error('Exception in step')
})

Given('an ambiguous step', function () {
// first one
})

Given('an ambiguous step', function () {
// second one
})

Given('a pending step', function () {
return 'pending'
})
6 changes: 1 addition & 5 deletions compatibility/features/skipped/skipped.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { Before, Given } from '../../../src'

Before('@skip', function () {
return 'skipped'
})
import { Given } from '../../../src'

Given('a step that does not skip', function () {
// no-op
Expand Down
Loading