From d6385979c100ab18dbb4c0aa8e745aa8821c1f52 Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 7 Jan 2025 21:13:06 +0000 Subject: [PATCH 1/6] bump cucumber packages --- package-lock.json | 307 +++++++++++++++++++++++----------------------- package.json | 14 +-- 2 files changed, 159 insertions(+), 162 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9bdcce87f..abe54a11d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,14 +10,14 @@ "license": "MIT", "dependencies": { "@cucumber/ci-environment": "10.0.1", - "@cucumber/cucumber-expressions": "17.1.0", - "@cucumber/gherkin": "28.0.0", + "@cucumber/cucumber-expressions": "18.0.1", + "@cucumber/gherkin": "30.0.4", "@cucumber/gherkin-streams": "5.0.1", "@cucumber/gherkin-utils": "9.0.0", - "@cucumber/html-formatter": "21.6.0", - "@cucumber/junit-xml-formatter": "0.6.0", + "@cucumber/html-formatter": "21.7.0", + "@cucumber/junit-xml-formatter": "0.7.1", "@cucumber/message-streams": "4.0.1", - "@cucumber/messages": "24.1.0", + "@cucumber/messages": "27.0.2", "@cucumber/tag-expressions": "6.1.1", "assertion-error-formatter": "^3.0.0", "capital-case": "^1.0.4", @@ -55,8 +55,8 @@ "cucumber-js": "bin/cucumber.js" }, "devDependencies": { - "@cucumber/compatibility-kit": "15.0.0", - "@cucumber/query": "12.1.2", + "@cucumber/compatibility-kit": "17.0.0", + "@cucumber/query": "13.0.3", "@microsoft/api-extractor": "7.39.0", "@sinonjs/fake-timers": "10.0.2", "@types/chai": "4.3.4", @@ -619,25 +619,28 @@ "integrity": "sha512-/+ooDMPtKSmvcPMDYnMZt4LuoipfFfHaYspStI4shqw8FyKcfQAmekz6G+QKWjQQrvM+7Hkljwx58MEwPCwwzg==" }, "node_modules/@cucumber/compatibility-kit": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/@cucumber/compatibility-kit/-/compatibility-kit-15.0.0.tgz", - "integrity": "sha512-5pzgNY0ylsQpcU0CxTBIRlo7+2F1helz/CUMbgE8E7IBxKVQ1czA/WgWtHoeVGm0i0zK5QE7TyDOUL5Nikek0Q==", - "dev": true + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/compatibility-kit/-/compatibility-kit-17.0.0.tgz", + "integrity": "sha512-P2AvE97VdHDBtITbp8H39Zn+wsJYDFf1mFQtkS6U2PZLcAmCtg2EgbLfKf8W2MZP/yH7lZDCigikgOrCuY3anQ==", + "dev": true, + "license": "MIT" }, "node_modules/@cucumber/cucumber-expressions": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-17.1.0.tgz", - "integrity": "sha512-PCv/ppsPynniKPWJr5v566daCVe+pbxQpHGrIu/Ev57cCH9Rv+X0F6lio4Id3Z64TaG7btCRLUGewIgLwmrwOA==", + "version": "18.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-18.0.1.tgz", + "integrity": "sha512-NSid6bI+7UlgMywl5octojY5NXnxR9uq+JisjOrO52VbFsQM6gTWuQFE8syI10KnIBEdPzuEUSVEeZ0VFzRnZA==", + "license": "MIT", "dependencies": { "regexp-match-indices": "1.0.2" } }, "node_modules/@cucumber/gherkin": { - "version": "28.0.0", - "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-28.0.0.tgz", - "integrity": "sha512-Ee6zJQq0OmIUPdW0mSnsCsrWA2PZAELNDPICD2pLfs0Oz7RAPgj80UsD2UCtqyAhw2qAR62aqlktKUlai5zl/A==", + "version": "30.0.4", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-30.0.4.tgz", + "integrity": "sha512-pb7lmAJqweZRADTTsgnC3F5zbTh3nwOB1M83Q9ZPbUKMb3P76PzK6cTcPTJBHWy3l7isbigIv+BkDjaca6C8/g==", + "license": "MIT", "dependencies": { - "@cucumber/messages": ">=19.1.4 <=24" + "@cucumber/messages": ">=19.1.4 <=26" } }, "node_modules/@cucumber/gherkin-streams": { @@ -680,6 +683,33 @@ "gherkin-utils": "bin/gherkin-utils" } }, + "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/gherkin": { + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-28.0.0.tgz", + "integrity": "sha512-Ee6zJQq0OmIUPdW0mSnsCsrWA2PZAELNDPICD2pLfs0Oz7RAPgj80UsD2UCtqyAhw2qAR62aqlktKUlai5zl/A==", + "license": "MIT", + "dependencies": { + "@cucumber/messages": ">=19.1.4 <=24" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/messages": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-24.1.0.tgz", + "integrity": "sha512-hxVHiBurORcobhVk80I9+JkaKaNXkW6YwGOEFIh/2aO+apAN+5XJgUUWjng9NwqaQrW1sCFuawLB1AuzmBaNdQ==", + "license": "MIT", + "dependencies": { + "@types/uuid": "9.0.8", + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.1", + "uuid": "9.0.1" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "license": "MIT" + }, "node_modules/@cucumber/gherkin-utils/node_modules/commander": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", @@ -688,40 +718,69 @@ "node": ">=18" } }, + "node_modules/@cucumber/gherkin-utils/node_modules/reflect-metadata": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.1.tgz", + "integrity": "sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==", + "deprecated": "This version has a critical bug in fallback handling. Please upgrade to reflect-metadata@0.2.2 or newer.", + "license": "Apache-2.0" + }, + "node_modules/@cucumber/gherkin-utils/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@cucumber/gherkin/node_modules/@cucumber/messages": { + "version": "26.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-26.0.1.tgz", + "integrity": "sha512-DIxSg+ZGariumO+Lq6bn4kOUIUET83A4umrnWmidjGFl8XxkBieUZtsmNbLYgH/gnsmP07EfxxdTr0hOchV1Sg==", + "license": "MIT", + "dependencies": { + "@types/uuid": "10.0.0", + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.2", + "uuid": "10.0.0" + } + }, "node_modules/@cucumber/html-formatter": { - "version": "21.6.0", - "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.6.0.tgz", - "integrity": "sha512-Qw1tdObBJrgXgXwVjKVjB3hFhFPI8WhIFb+ULy8g5lDl5AdnKDiyDXAMvAWRX+pphnRMMNdkPCt6ZXEfWvUuAA==", + "version": "21.7.0", + "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.7.0.tgz", + "integrity": "sha512-bv211aY8mErp6CdmhN426E+7KIsVIES4fGx5ASMlUzYWiMus6NhSdI9UL3Vswx8JXJMgySeIcJJKfznREUFLNA==", "license": "MIT", "peerDependencies": { "@cucumber/messages": ">=18" } }, "node_modules/@cucumber/junit-xml-formatter": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@cucumber/junit-xml-formatter/-/junit-xml-formatter-0.6.0.tgz", - "integrity": "sha512-++PAuxliQhq7yr2Bn9P0fwBUo46OoKAK5f6M4PrwoHBqIsl/6pUS4mqpviuBrgZ8RD7BTrmASk4lUDJClAz/qA==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@cucumber/junit-xml-formatter/-/junit-xml-formatter-0.7.1.tgz", + "integrity": "sha512-AzhX+xFE/3zfoYeqkT7DNq68wAQfBcx4Dk9qS/ocXM2v5tBv6eFQ+w8zaSfsktCjYzu4oYRH/jh4USD1CYHfaQ==", "license": "MIT", "dependencies": { "@cucumber/query": "^13.0.2", "@teppeis/multimaps": "^3.0.0", + "luxon": "^3.5.0", "xmlbuilder": "^15.1.1" }, "peerDependencies": { "@cucumber/messages": "*" } }, - "node_modules/@cucumber/junit-xml-formatter/node_modules/@cucumber/query": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/@cucumber/query/-/query-13.0.2.tgz", - "integrity": "sha512-ykjwL99F5ZmJ3XnIRPe/eA8LvfSTc+C6ZZXrD5QrAfhfMRomBNpZT03MNnxrJ92ge18eDbculhclrIJQiVJCJg==", + "node_modules/@cucumber/junit-xml-formatter/node_modules/luxon": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", "license": "MIT", - "dependencies": { - "@teppeis/multimaps": "3.0.0", - "assert": "^2.1.0" - }, - "peerDependencies": { - "@cucumber/messages": "*" + "engines": { + "node": ">=12" } }, "node_modules/@cucumber/message-streams": { @@ -733,41 +792,27 @@ } }, "node_modules/@cucumber/messages": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-24.1.0.tgz", - "integrity": "sha512-hxVHiBurORcobhVk80I9+JkaKaNXkW6YwGOEFIh/2aO+apAN+5XJgUUWjng9NwqaQrW1sCFuawLB1AuzmBaNdQ==", + "version": "27.0.2", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-27.0.2.tgz", + "integrity": "sha512-jo2B+vYXmpuLOKh6Gc8loHl2E8svCkLvEXLVgFwVHqKWZJWBTa9yTRCPmZIxrz4fnO7Pr3N3vKQCPu73/gjlVQ==", + "license": "MIT", "dependencies": { - "@types/uuid": "9.0.8", + "@types/uuid": "10.0.0", "class-transformer": "0.5.1", - "reflect-metadata": "0.2.1", - "uuid": "9.0.1" - } - }, - "node_modules/@cucumber/messages/node_modules/reflect-metadata": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.1.tgz", - "integrity": "sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==" - }, - "node_modules/@cucumber/messages/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" + "reflect-metadata": "0.2.2", + "uuid": "10.0.0" } }, "node_modules/@cucumber/query": { - "version": "12.1.2", - "resolved": "https://registry.npmjs.org/@cucumber/query/-/query-12.1.2.tgz", - "integrity": "sha512-0LPJj2Yt+IjGnOp8HO8GRuLq6S8a9VLtTAaxJiSP0fb81HyktqZuBetnlbXLf0ahySQ70LVyDJzaVDZLdztuiQ==", - "dev": true, + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/@cucumber/query/-/query-13.0.3.tgz", + "integrity": "sha512-OdGea9D9wIoCY2RvcdG5/b2FYASvOdsOIObtv8dU8/kwPXHPo/UxcF+fWElr8yciu+BQMBa8NCxDsoU3ijQqZg==", + "license": "MIT", "dependencies": { - "@cucumber/messages": "^24.0.0", "@teppeis/multimaps": "3.0.0" + }, + "peerDependencies": { + "@cucumber/messages": "*" } }, "node_modules/@cucumber/tag-expressions": { @@ -1829,9 +1874,10 @@ "license": "MIT" }, "node_modules/@types/uuid": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", - "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==" + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "6.7.4", @@ -2453,19 +2499,6 @@ "node": ">=0.10.0" } }, - "node_modules/assert": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", - "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "is-nan": "^1.3.2", - "object-is": "^1.1.5", - "object.assign": "^4.1.4", - "util": "^0.12.5" - } - }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -2489,6 +2522,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -2660,6 +2694,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -3198,6 +3233,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -3215,6 +3251,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -3574,6 +3611,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.4" @@ -3586,6 +3624,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4482,6 +4521,7 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -4664,6 +4704,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -4866,6 +4907,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -4937,6 +4979,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" @@ -4949,6 +4992,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -4960,6 +5004,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -4971,6 +5016,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -5010,6 +5056,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -5206,7 +5253,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/ini": { "version": "2.0.0", @@ -5257,22 +5305,6 @@ "node": ">=8" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", @@ -5351,6 +5383,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -5401,21 +5434,6 @@ "node": ">=8" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "license": "MIT", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -5443,22 +5461,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-nan": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", - "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", @@ -5585,6 +5587,7 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, "dependencies": { "which-typed-array": "^1.1.11" }, @@ -6818,26 +6821,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, "engines": { "node": ">= 0.4" } @@ -6846,6 +6834,7 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -7612,6 +7601,12 @@ "node": ">=8" } }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0" + }, "node_modules/regex": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/regex/-/regex-5.0.2.tgz", @@ -8059,6 +8054,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", @@ -9197,19 +9193,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, "node_modules/util-arity": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz", @@ -9224,6 +9207,19 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -9327,6 +9323,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", diff --git a/package.json b/package.json index 4d6992e93..f848217e8 100644 --- a/package.json +++ b/package.json @@ -217,14 +217,14 @@ }, "dependencies": { "@cucumber/ci-environment": "10.0.1", - "@cucumber/cucumber-expressions": "17.1.0", - "@cucumber/gherkin": "28.0.0", + "@cucumber/cucumber-expressions": "18.0.1", + "@cucumber/gherkin": "30.0.4", "@cucumber/gherkin-streams": "5.0.1", "@cucumber/gherkin-utils": "9.0.0", - "@cucumber/html-formatter": "21.6.0", - "@cucumber/junit-xml-formatter": "0.6.0", + "@cucumber/html-formatter": "21.7.0", + "@cucumber/junit-xml-formatter": "0.7.1", "@cucumber/message-streams": "4.0.1", - "@cucumber/messages": "24.1.0", + "@cucumber/messages": "27.0.2", "@cucumber/tag-expressions": "6.1.1", "assertion-error-formatter": "^3.0.0", "capital-case": "^1.0.4", @@ -259,8 +259,8 @@ "yup": "1.2.0" }, "devDependencies": { - "@cucumber/compatibility-kit": "15.0.0", - "@cucumber/query": "12.1.2", + "@cucumber/compatibility-kit": "17.0.0", + "@cucumber/query": "13.0.3", "@microsoft/api-extractor": "7.39.0", "@sinonjs/fake-timers": "10.0.2", "@types/chai": "4.3.4", From 38179a85d41c6037b0cef061f9c40a02175a6fcc Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 7 Jan 2025 21:59:57 +0000 Subject: [PATCH 2/6] include testRunStartedId --- features/support/formatter_output_helpers.ts | 1 + src/assemble/assemble_test_cases.ts | 17 +++--- src/assemble/assemble_test_cases_spec.ts | 39 ++++++++------ src/runtime/coordinator.ts | 17 +++--- src/runtime/test_case_runner_spec.ts | 55 ++++++++++---------- 5 files changed, 71 insertions(+), 58 deletions(-) diff --git a/features/support/formatter_output_helpers.ts b/features/support/formatter_output_helpers.ts index c74038cac..07f2dd0ed 100644 --- a/features/support/formatter_output_helpers.ts +++ b/features/support/formatter_output_helpers.ts @@ -110,6 +110,7 @@ export const ignorableKeys = [ 'pickleId', 'pickleStepId', 'stepDefinitionIds', + 'testRunStartedId', 'testCaseId', 'testCaseStartedId', 'testStepId', diff --git a/src/assemble/assemble_test_cases.ts b/src/assemble/assemble_test_cases.ts index 0803fb233..2e3ef0f5f 100644 --- a/src/assemble/assemble_test_cases.ts +++ b/src/assemble/assemble_test_cases.ts @@ -12,17 +12,13 @@ import { SupportCodeLibrary } from '../support_code_library_builder/types' import { doesHaveValue } from '../value_checker' import { AssembledTestCase, SourcedPickle } from './types' -export async function assembleTestCases({ - eventBroadcaster, - newId, - sourcedPickles, - supportCodeLibrary, -}: { - eventBroadcaster: EventEmitter - newId: IdGenerator.NewId - sourcedPickles: ReadonlyArray +export async function assembleTestCases( + testRunStartedId: string, + eventBroadcaster: EventEmitter, + newId: IdGenerator.NewId, + sourcedPickles: ReadonlyArray, supportCodeLibrary: SupportCodeLibrary -}): Promise> { +): Promise> { return sourcedPickles.map(({ gherkinDocument, pickle }) => { const testCaseId = newId() const fromBeforeHooks: TestStep[] = makeBeforeHookSteps({ @@ -41,6 +37,7 @@ export async function assembleTestCases({ newId, }) const testCase: TestCase = { + testRunStartedId, pickleId: pickle.id, id: testCaseId, testSteps: [ diff --git a/src/assemble/assemble_test_cases_spec.ts b/src/assemble/assemble_test_cases_spec.ts index 9bca85c46..56353cd3c 100644 --- a/src/assemble/assemble_test_cases_spec.ts +++ b/src/assemble/assemble_test_cases_spec.ts @@ -31,12 +31,17 @@ async function testAssembleTestCases({ const envelopes: Envelope[] = [] const eventBroadcaster = new EventEmitter() eventBroadcaster.on('envelope', (e) => envelopes.push(e)) - const result = await assembleTestCases({ + const newId = IdGenerator.incrementing() + const result = await assembleTestCases( + newId(), eventBroadcaster, - newId: IdGenerator.incrementing(), - sourcedPickles: pickles.map((pickle) => ({ gherkinDocument, pickle })), - supportCodeLibrary, - }) + newId, + pickles.map((pickle) => ({ + gherkinDocument, + pickle, + })), + supportCodeLibrary + ) return { envelopes, result } } @@ -78,11 +83,12 @@ describe('assembleTestCases', () => { }) const testCase0: TestCase = { - id: '0', + testRunStartedId: '0', + id: '1', pickleId: pickles[0].id, testSteps: [ { - id: '1', + id: '2', pickleStepId: pickles[0].steps[0].id, stepDefinitionIds: [supportCodeLibrary.stepDefinitions[0].id], stepMatchArgumentsLists: [ @@ -95,11 +101,12 @@ describe('assembleTestCases', () => { } const testCase1: TestCase = { - id: '2', + testRunStartedId: '0', + id: '3', pickleId: pickles[1].id, testSteps: [ { - id: '3', + id: '4', pickleStepId: pickles[1].steps[0].id, stepDefinitionIds: [supportCodeLibrary.stepDefinitions[0].id], stepMatchArgumentsLists: [ @@ -236,15 +243,16 @@ describe('assembleTestCases', () => { // Assert expect(envelopes[0]).to.eql({ testCase: { - id: '0', + testRunStartedId: '0', + id: '1', pickleId: pickles[0].id, testSteps: [ { - id: '1', + id: '2', hookId: supportCodeLibrary.beforeTestCaseHookDefinitions[0].id, }, { - id: '2', + id: '3', pickleStepId: pickles[0].steps[0].id, stepDefinitionIds: [supportCodeLibrary.stepDefinitions[0].id], stepMatchArgumentsLists: [ @@ -254,7 +262,7 @@ describe('assembleTestCases', () => { ], }, { - id: '3', + id: '4', hookId: supportCodeLibrary.afterTestCaseHookDefinitions[0].id, }, ], @@ -290,11 +298,12 @@ describe('assembleTestCases', () => { // Assert expect(envelopes[0]).to.eql({ testCase: { - id: '0', + testRunStartedId: '0', + id: '1', pickleId: pickles[0].id, testSteps: [ { - id: '1', + id: '2', pickleStepId: pickles[0].steps[0].id, stepDefinitionIds: [supportCodeLibrary.stepDefinitions[0].id], stepMatchArgumentsLists: [ diff --git a/src/runtime/coordinator.ts b/src/runtime/coordinator.ts index 116276afd..13b64fc92 100644 --- a/src/runtime/coordinator.ts +++ b/src/runtime/coordinator.ts @@ -16,23 +16,28 @@ export class Coordinator implements Runtime { ) {} async run(): Promise { + const testRunStartedId = this.newId() + this.eventBroadcaster.emit('envelope', { testRunStarted: { + id: testRunStartedId, timestamp: timestamp(), }, } satisfies Envelope) - const assembledTestCases = await assembleTestCases({ - eventBroadcaster: this.eventBroadcaster, - newId: this.newId, - sourcedPickles: this.sourcedPickles, - supportCodeLibrary: this.supportCodeLibrary, - }) + const assembledTestCases = await assembleTestCases( + testRunStartedId, + this.eventBroadcaster, + this.newId, + this.sourcedPickles, + this.supportCodeLibrary + ) const success = await this.adapter.run(assembledTestCases) this.eventBroadcaster.emit('envelope', { testRunFinished: { + testRunStartedId, timestamp: timestamp(), success, }, diff --git a/src/runtime/test_case_runner_spec.ts b/src/runtime/test_case_runner_spec.ts index 0a84c3190..dad4d418c 100644 --- a/src/runtime/test_case_runner_spec.ts +++ b/src/runtime/test_case_runner_spec.ts @@ -29,17 +29,18 @@ async function testRunner(options: { const eventBroadcaster = new EventEmitter() const newId = IdGenerator.incrementing() const testCase = ( - await assembleTestCases({ + await assembleTestCases( + newId(), eventBroadcaster, newId, - sourcedPickles: [ + [ { gherkinDocument: options.gherkinDocument, pickle: options.pickle, }, ], - supportCodeLibrary: options.supportCodeLibrary, - }) + options.supportCodeLibrary + ) )[0].testCase // listen for envelopers _after_ we've assembled test cases @@ -112,29 +113,29 @@ describe('TestCaseRunner', () => { { testCaseStarted: { attempt: 0, - id: '2', - testCaseId: '0', + id: '3', + testCaseId: '1', timestamp: predictableTimestamp(0), }, }, { testStepStarted: { - testCaseStartedId: '2', - testStepId: '1', + testCaseStartedId: '3', + testStepId: '2', timestamp: predictableTimestamp(0), }, }, { testStepFinished: { - testCaseStartedId: '2', + testCaseStartedId: '3', testStepResult: passedTestResult, - testStepId: '1', + testStepId: '2', timestamp: predictableTimestamp(1), }, }, { testCaseFinished: { - testCaseStartedId: '2', + testCaseStartedId: '3', timestamp: predictableTimestamp(1), willBeRetried: false, }, @@ -294,21 +295,21 @@ describe('TestCaseRunner', () => { { testCaseStarted: { attempt: 0, - id: '2', - testCaseId: '0', + id: '3', + testCaseId: '1', timestamp: predictableTimestamp(0), }, }, { testStepStarted: { - testCaseStartedId: '2', - testStepId: '1', + testCaseStartedId: '3', + testStepId: '2', timestamp: predictableTimestamp(0), }, }, { testStepFinished: { - testCaseStartedId: '2', + testCaseStartedId: '3', testStepResult: { duration: messages.TimeConversion.millisecondsToDuration(1), message: 'Oh no!', @@ -319,13 +320,13 @@ describe('TestCaseRunner', () => { }, status: messages.TestStepResultStatus.FAILED, }, - testStepId: '1', + testStepId: '2', timestamp: predictableTimestamp(1), }, }, { testCaseFinished: { - testCaseStartedId: '2', + testCaseStartedId: '3', timestamp: predictableTimestamp(1), willBeRetried: true, }, @@ -333,32 +334,32 @@ describe('TestCaseRunner', () => { { testCaseStarted: { attempt: 1, - id: '3', - testCaseId: '0', + id: '4', + testCaseId: '1', timestamp: predictableTimestamp(1), }, }, { testStepStarted: { - testCaseStartedId: '3', - testStepId: '1', + testCaseStartedId: '4', + testStepId: '2', timestamp: predictableTimestamp(1), }, }, { testStepFinished: { - testCaseStartedId: '3', + testCaseStartedId: '4', testStepResult: { duration: messages.TimeConversion.millisecondsToDuration(1), status: messages.TestStepResultStatus.PASSED, }, - testStepId: '1', + testStepId: '2', timestamp: predictableTimestamp(2), }, }, { testCaseFinished: { - testCaseStartedId: '3', + testCaseStartedId: '4', timestamp: predictableTimestamp(2), willBeRetried: false, }, @@ -561,8 +562,8 @@ describe('TestCaseRunner', () => { testCaseStarted: { workerId: 'foo', attempt: 0, - id: '2', - testCaseId: '0', + id: '3', + testCaseId: '1', timestamp: predictableTimestamp(0), }, }) From 856dc765086f143445d4b46fbacb7a3a70606ce9 Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 7 Jan 2025 22:24:08 +0000 Subject: [PATCH 3/6] include hook types --- src/cli/helpers.ts | 60 ++++++++++++++++++++++++----------------- src/cli/helpers_spec.ts | 8 +++++- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/cli/helpers.ts b/src/cli/helpers.ts index 0f2790d86..a5f949c6c 100644 --- a/src/cli/helpers.ts +++ b/src/cli/helpers.ts @@ -2,11 +2,9 @@ import { EventEmitter } from 'node:events' import os from 'node:os' import shuffle from 'knuth-shuffle-seeded' import * as messages from '@cucumber/messages' -import { IdGenerator } from '@cucumber/messages' +import { Envelope, HookType, IdGenerator } from '@cucumber/messages' import detectCiEnvironment from '@cucumber/ci-environment' import { SupportCodeLibrary } from '../support_code_library_builder/types' -import TestCaseHookDefinition from '../models/test_case_hook_definition' -import TestRunHookDefinition from '../models/test_run_hook_definition' import { version } from '../version' import { ILogger } from '../environment' import { ILineAndUri } from '../types' @@ -144,42 +142,54 @@ function emitTestCaseHooks( supportCodeLibrary: SupportCodeLibrary, eventBroadcaster: EventEmitter ): void { - ;[] - .concat( + ;[ + [ supportCodeLibrary.beforeTestCaseHookDefinitions, - supportCodeLibrary.afterTestCaseHookDefinitions - ) - .forEach((testCaseHookDefinition: TestCaseHookDefinition) => { - const envelope: messages.Envelope = { + HookType.BEFORE_TEST_CASE, + ] as const, + [ + supportCodeLibrary.afterTestCaseHookDefinitions, + HookType.AFTER_TEST_CASE, + ] as const, + ].forEach(([hooks, type]) => { + hooks.forEach((hook) => { + eventBroadcaster.emit('envelope', { hook: { - id: testCaseHookDefinition.id, - name: testCaseHookDefinition.name, - tagExpression: testCaseHookDefinition.tagExpression, - sourceReference: makeSourceReference(testCaseHookDefinition), + id: hook.id, + type, + name: hook.name, + tagExpression: hook.tagExpression, + sourceReference: makeSourceReference(hook), }, - } - eventBroadcaster.emit('envelope', envelope) + } satisfies Envelope) }) + }) } function emitTestRunHooks( supportCodeLibrary: SupportCodeLibrary, eventBroadcaster: EventEmitter ): void { - ;[] - .concat( + ;[ + [ supportCodeLibrary.beforeTestRunHookDefinitions, - supportCodeLibrary.afterTestRunHookDefinitions - ) - .forEach((testRunHookDefinition: TestRunHookDefinition) => { - const envelope: messages.Envelope = { + HookType.BEFORE_TEST_RUN, + ] as const, + [ + supportCodeLibrary.afterTestRunHookDefinitions, + HookType.AFTER_TEST_RUN, + ] as const, + ].forEach(([hooks, type]) => { + hooks.forEach((hook) => { + eventBroadcaster.emit('envelope', { hook: { - id: testRunHookDefinition.id, - sourceReference: makeSourceReference(testRunHookDefinition), + id: hook.id, + type, + sourceReference: makeSourceReference(hook), }, - } - eventBroadcaster.emit('envelope', envelope) + } satisfies Envelope) }) + }) } export function emitSupportCodeMessages({ diff --git a/src/cli/helpers_spec.ts b/src/cli/helpers_spec.ts index 4430249bf..0441d6ed8 100644 --- a/src/cli/helpers_spec.ts +++ b/src/cli/helpers_spec.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'node:events' import * as messages from '@cucumber/messages' -import { IdGenerator } from '@cucumber/messages' +import { HookType, IdGenerator } from '@cucumber/messages' import { expect } from 'chai' import { describe, it } from 'mocha' import { @@ -227,6 +227,7 @@ describe('helpers', () => { { hook: { id: '0', + type: HookType.BEFORE_TEST_CASE, name: 'before hook', tagExpression: '@hooks-tho', sourceReference: { @@ -240,6 +241,7 @@ describe('helpers', () => { { hook: { id: '1', + type: HookType.AFTER_TEST_CASE, name: 'after hook', tagExpression: undefined, sourceReference: { @@ -253,6 +255,7 @@ describe('helpers', () => { { hook: { id: '2', + type: HookType.AFTER_TEST_CASE, name: undefined, tagExpression: undefined, sourceReference: { @@ -302,6 +305,7 @@ describe('helpers', () => { { hook: { id: '0', + type: HookType.BEFORE_TEST_RUN, sourceReference: { uri: 'features/support/run-hooks.js', location: { @@ -313,6 +317,7 @@ describe('helpers', () => { { hook: { id: '1', + type: HookType.AFTER_TEST_RUN, sourceReference: { uri: 'features/support/run-hooks.js', location: { @@ -324,6 +329,7 @@ describe('helpers', () => { { hook: { id: '2', + type: HookType.AFTER_TEST_RUN, sourceReference: { uri: 'features/support/run-hooks.js', location: { From c8f645d3c364ef9dd041de5882a3ad1e02b5c09b Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 7 Jan 2025 22:24:17 +0000 Subject: [PATCH 4/6] update cck support code --- .../features/attachments/attachments.ts | 8 +++-- .../examples-tables/examples-tables.ts | 31 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/compatibility/features/attachments/attachments.ts b/compatibility/features/attachments/attachments.ts index 031a2161a..179e424fc 100644 --- a/compatibility/features/attachments/attachments.ts +++ b/compatibility/features/attachments/attachments.ts @@ -1,8 +1,6 @@ import fs from 'node:fs' import path from 'node:path' -import { Before, When } from '../../../src' - -Before(() => undefined) +import { When } from '../../../src' When( 'the string {string} is attached as {string}', @@ -90,3 +88,7 @@ When('a PDF document is attached and renamed', async function () { } ) }) + +When('a link to {string} is attached', async function (uri: string) { + this.link(uri) +}) diff --git a/compatibility/features/examples-tables/examples-tables.ts b/compatibility/features/examples-tables/examples-tables.ts index 04564b0bd..b8020d406 100644 --- a/compatibility/features/examples-tables/examples-tables.ts +++ b/compatibility/features/examples-tables/examples-tables.ts @@ -1,24 +1,23 @@ import assert from 'node:assert' import { Given, When, Then } from '../../../src' -type World = { - count: number -} +Given('there are {int} cucumbers', function (initialCount: number) { + this.count = initialCount +}) -Given( - 'there are {int} cucumbers', - function (this: World, initialCount: number) { - this.count = initialCount - } -) +Given('there are {int} friends', function (initialFriends: number) { + this.friends = initialFriends +}) -When('I eat {int} cucumbers', function (this: World, eatCount: number) { +When('I eat {int} cucumbers', function (eatCount: number) { this.count -= eatCount }) -Then( - 'I should have {int} cucumbers', - function (this: World, expectedCount: number) { - assert.strictEqual(this.count, expectedCount) - } -) +Then('I should have {int} cucumbers', function (expectedCount: number) { + assert.strictEqual(this.count, expectedCount) +}) + +Then('each person can eat {int} cucumbers', function (expectedShare) { + const share = Math.floor(this.count / (1 + this.friends)) + assert.strictEqual(share, expectedShare) +}) From 0215f5701d6a473020c5ebe9bdd1df57fe7a8397 Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 7 Jan 2025 23:15:17 +0000 Subject: [PATCH 5/6] update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b7868ece..a83f6735d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Please see [CONTRIBUTING.md](./CONTRIBUTING.md) on how to contribute to Cucumber. ## [Unreleased] +### Added +- `junit` formatter now includes `timestamp` attribute ([junit-xml-formatter#45](https://github.com/cucumber/junit-xml-formatter/pull/45)) +- `Hook` message now includes `type` ([#2463](https://github.com/cucumber/cucumber-js/pull/2463)) +- `TestRunStarted` message now includes `id`; `TestCase` and `TestRunFinished` messages reference it in `testRunStartedId` ([#2463](https://github.com/cucumber/cucumber-js/pull/2463)) ## [11.1.1] - 2024-12-11 ### Fixed From 09400ea0030ffc0edcbf5748ff9e378c11b2a118 Mon Sep 17 00:00:00 2001 From: David Goss Date: Tue, 7 Jan 2025 23:17:26 +0000 Subject: [PATCH 6/6] remove unnecessary faff with messages import --- .../helpers/gherkin_document_parser_spec.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/formatter/helpers/gherkin_document_parser_spec.ts b/src/formatter/helpers/gherkin_document_parser_spec.ts index dd62a89cb..b983782cd 100644 --- a/src/formatter/helpers/gherkin_document_parser_spec.ts +++ b/src/formatter/helpers/gherkin_document_parser_spec.ts @@ -1,7 +1,7 @@ import { describe, it } from 'mocha' import { expect } from 'chai' import { reindent } from 'reindent-template-literals' -import * as messages from '@cucumber/messages' +import { GherkinDocument } from '@cucumber/messages' import { IParsedSourceWithEnvelopes, parse, @@ -13,8 +13,6 @@ import { getGherkinStepMap, } from './gherkin_document_parser' -import IGherkinDocument = messages.GherkinDocument - describe('GherkinDocumentParser', () => { describe('getGherkinStepMap', () => { it('works for a Background and Scenario', async () => { @@ -308,7 +306,7 @@ describe('GherkinDocumentParser', () => { }) }) -async function parseGherkinDocument(data: string): Promise { +async function parseGherkinDocument(data: string): Promise { const parsed: IParsedSourceWithEnvelopes = await parse({ data, uri: 'features/a.feature', @@ -316,7 +314,7 @@ async function parseGherkinDocument(data: string): Promise { return parsed.gherkinDocument } -async function withBackgroundAndScenario(): Promise { +async function withBackgroundAndScenario(): Promise { return await parseGherkinDocument( reindent(` Feature: a feature @@ -329,7 +327,7 @@ async function withBackgroundAndScenario(): Promise { ) } -async function withBackgroundAndScenarioOutline(): Promise { +async function withBackgroundAndScenarioOutline(): Promise { return await parseGherkinDocument( reindent(` Feature: a feature @@ -346,7 +344,7 @@ async function withBackgroundAndScenarioOutline(): Promise { ) } -async function withBackgroundAndRuleWithExamples(): Promise { +async function withBackgroundAndRuleWithExamples(): Promise { return await parseGherkinDocument( reindent(` Feature: a feature @@ -365,7 +363,7 @@ async function withBackgroundAndRuleWithExamples(): Promise { ) } -async function withBackgroundAndRuleWithBackgroundAndExamples(): Promise { +async function withBackgroundAndRuleWithBackgroundAndExamples(): Promise { return await parseGherkinDocument( reindent(` Feature: a feature