From 6052d85b570e71cbf6791b9b9eb2f3c647d33655 Mon Sep 17 00:00:00 2001 From: David Goss Date: Sun, 3 Aug 2025 12:33:24 +0100 Subject: [PATCH 1/4] Update cck plumbing --- test/cck/cck.spec.ts | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/test/cck/cck.spec.ts b/test/cck/cck.spec.ts index 00eb6bf..189f080 100644 --- a/test/cck/cck.spec.ts +++ b/test/cck/cck.spec.ts @@ -7,6 +7,7 @@ import { makeTestHarness } from '../utils.js' import { globSync } from 'node:fs' import { Envelope } from '@cucumber/messages' import { Env } from '@cucumber/ci-environment' +import { globby, globbySync } from 'globby' use(chaiExclude) @@ -43,27 +44,32 @@ const UNSUPPORTED = [ ] describe('Cucumber Compatibility Kit', () => { - const ndjsonPaths = globSync('node_modules/@cucumber/compatibility-kit/features/**/*.ndjson') - for (const ndjsonPath of ndjsonPaths) { - const [, name, extension] = /^.+[/\\](.+)(\.feature(?:\.md)?)\.ndjson$/.exec( - ndjsonPath - ) as RegExpExecArray + const directories = globbySync('node_modules/@cucumber/compatibility-kit/features', { + onlyDirectories: true, + }) + for (const directory of directories) { + const suite = path.basename(directory) - it(name, async function () { - if (UNSUPPORTED.includes(name)) { + it(suite, async function () { + if (UNSUPPORTED.includes(suite)) { return this.skip() } const harness = await makeTestHarness() - await harness.copyDir(path.join(process.cwd(), 'test', 'cck', name), 'features') - await harness.copyFile( - path.join(CCK_PATH, 'features', name, name + extension), - path.join('features', name + extension) - ) + await harness.copyDir(path.join(process.cwd(), 'test', 'cck', suite), 'features') + const featurePaths = await globby(['*.feature', '*.feature.md'], { cwd: directory }) + for (const featurePath of featurePaths) { + await harness.copyFile( + path.join(CCK_PATH, 'features', suite, featurePath), + path.join('features', featurePath) + ) + } const [actualOutput] = await harness.run('@cucumber/node/reporters/message') - const expectedOutput = await readFile(ndjsonPath, { encoding: 'utf-8' }) + const expectedOutput = await readFile(path.join(directory, suite + '.ndjson'), { + encoding: 'utf-8', + }) const actualEnvelopes = parseEnvelopes(actualOutput) const expectedEnvelopes = parseEnvelopes(expectedOutput) From ce849343b02fed1ff5c2ae92cf92614ab17ef1b9 Mon Sep 17 00:00:00 2001 From: David Goss Date: Sun, 3 Aug 2025 12:40:02 +0100 Subject: [PATCH 2/4] use correct glob --- test/cck/cck.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cck/cck.spec.ts b/test/cck/cck.spec.ts index 189f080..675368d 100644 --- a/test/cck/cck.spec.ts +++ b/test/cck/cck.spec.ts @@ -44,7 +44,7 @@ const UNSUPPORTED = [ ] describe('Cucumber Compatibility Kit', () => { - const directories = globbySync('node_modules/@cucumber/compatibility-kit/features', { + const directories = globbySync('node_modules/@cucumber/compatibility-kit/features/*', { onlyDirectories: true, }) for (const directory of directories) { From 4622c449300fd53ff3da494ff02f568607a7b659 Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 12 Aug 2025 20:47:51 +0100 Subject: [PATCH 3/4] use the published package --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a61091..7efc7e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "type-fest": "^4.33.0" }, "devDependencies": { - "@cucumber/compatibility-kit": "^19.0.0", + "@cucumber/compatibility-kit": "^20.0.0", "@eslint/compat": "^1.2.5", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.18.0", @@ -67,9 +67,9 @@ "license": "MIT" }, "node_modules/@cucumber/compatibility-kit": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/@cucumber/compatibility-kit/-/compatibility-kit-19.0.0.tgz", - "integrity": "sha512-wGFDDHo5vlkYo5YOCvfU0sjXjLizK2jKFojymrJB8kZo1wvcIDnWHriyizbUyOw1Aey2JvN9gI2mYcjwBpegVg==", + "version": "20.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/compatibility-kit/-/compatibility-kit-20.0.0.tgz", + "integrity": "sha512-hrlelLdOP7ojqSDxbuzBLSfrwbV4js0ew2FlOqa2kTf/dOLrynhAvtPyDw0001xNBhqXr5YtGZIas/2WWkP5vA==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 7d5dce4..44b7d84 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "type-fest": "^4.33.0" }, "devDependencies": { - "@cucumber/compatibility-kit": "^19.0.0", + "@cucumber/compatibility-kit": "^20.0.0", "@eslint/compat": "^1.2.5", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.18.0", From d2fe6f47866f180464ae914baa1828575d596f16 Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 12 Aug 2025 20:52:16 +0100 Subject: [PATCH 4/4] remove unused imports --- test/cck/cck.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/cck/cck.spec.ts b/test/cck/cck.spec.ts index 675368d..995a39e 100644 --- a/test/cck/cck.spec.ts +++ b/test/cck/cck.spec.ts @@ -4,9 +4,7 @@ import path from 'node:path' import { expect, use } from 'chai' import chaiExclude from 'chai-exclude' import { makeTestHarness } from '../utils.js' -import { globSync } from 'node:fs' import { Envelope } from '@cucumber/messages' -import { Env } from '@cucumber/ci-environment' import { globby, globbySync } from 'globby' use(chaiExclude)