From 09ec90116605db3caf484454c98457fa5ab19662 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:11:43 +0000 Subject: [PATCH 1/5] chore(deps-dev): bump @biomejs/biome from 1.9.4 to 2.1.1 Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.9.4 to 2.1.1. - [Release notes](https://github.com/biomejs/biome/releases) - [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md) - [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.1.1/packages/@biomejs/biome) --- updated-dependencies: - dependency-name: "@biomejs/biome" dependency-version: 2.1.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 152 +++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 137 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index a05bc10..30a9fed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "vitest-cucumber": "dist/cli-generate.js" }, "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.1.1", "@commitlint/cli": "^19.8.1", "@commitlint/config-conventional": "^19.8.1", "@types/node": "^20.4.5", @@ -114,11 +114,11 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.1.1.tgz", + "integrity": "sha512-HFGYkxG714KzG+8tvtXCJ1t1qXQMzgWzfvQaUjxN6UeKv+KvMEuliInnbZLJm6DXFXwqVi6446EGI0sGBLIYng==", "dev": true, - "hasInstallScript": true, + "license": "MIT OR Apache-2.0", "bin": { "biome": "bin/biome" }, @@ -130,24 +130,42 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.1.1", + "@biomejs/cli-darwin-x64": "2.1.1", + "@biomejs/cli-linux-arm64": "2.1.1", + "@biomejs/cli-linux-arm64-musl": "2.1.1", + "@biomejs/cli-linux-x64": "2.1.1", + "@biomejs/cli-linux-x64-musl": "2.1.1", + "@biomejs/cli-win32-arm64": "2.1.1", + "@biomejs/cli-win32-x64": "2.1.1" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.1.1.tgz", + "integrity": "sha512-2Muinu5ok4tWxq4nu5l19el48cwCY/vzvI7Vjbkf3CYIQkjxZLyj0Ad37Jv2OtlXYaLvv+Sfu1hFeXt/JwRRXQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.1.1.tgz", + "integrity": "sha512-cC8HM5lrgKQXLAK+6Iz2FrYW5A62pAAX6KAnRlEyLb+Q3+Kr6ur/sSuoIacqlp1yvmjHJqjYfZjPvHWnqxoEIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", "optional": true, "os": [ "darwin" @@ -156,6 +174,108 @@ "node": ">=14.21.3" } }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.1.1.tgz", + "integrity": "sha512-tw4BEbhAUkWPe4WBr6IX04DJo+2jz5qpPzpW/SWvqMjb9QuHY8+J0M23V8EPY/zWU4IG8Ui0XESapR1CB49Q7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.1.1.tgz", + "integrity": "sha512-/7FBLnTswu4jgV9ttI3AMIdDGqVEPIZd8I5u2D4tfCoj8rl9dnjrEQbAIDlWhUXdyWlFSz8JypH3swU9h9P+2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.1.1.tgz", + "integrity": "sha512-3WJ1GKjU7NzZb6RTbwLB59v9cTIlzjbiFLDB0z4376TkDqoNYilJaC37IomCr/aXwuU8QKkrYoHrgpSq5ffJ4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.1.1.tgz", + "integrity": "sha512-kUu+loNI3OCD2c12cUt7M5yaaSjDnGIksZwKnueubX6c/HWUyi/0mPbTBHR49Me3F0KKjWiKM+ZOjsmC+lUt9g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.1.1.tgz", + "integrity": "sha512-vEHK0v0oW+E6RUWLoxb2isI3rZo57OX9ZNyyGH701fZPj6Il0Rn1f5DMNyCmyflMwTnIQstEbs7n2BxYSqQx4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.1.1.tgz", + "integrity": "sha512-i2PKdn70kY++KEF/zkQFvQfX1e8SkA8hq4BgC+yE9dZqyLzB/XStY2MvwI3qswlRgnGpgncgqe0QYKVS1blksg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@commitlint/cli": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.8.1.tgz", diff --git a/package.json b/package.json index 8d1a527..a3d4b4b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "author": "amiceli", "license": "ISC", "devDependencies": { - "@biomejs/biome": "1.9.4", + "@biomejs/biome": "2.1.1", "@commitlint/cli": "^19.8.1", "@commitlint/config-conventional": "^19.8.1", "@types/node": "^20.4.5", From 8a5e1d1fd08a73b107f17c973264ede31da4118a Mon Sep 17 00:00:00 2001 From: amiceli Date: Sun, 20 Jul 2025 16:09:23 +0200 Subject: [PATCH 2/5] chore: lint code with new biome version --- src/browser/index.ts | 12 +++++------ src/errors/__tests__/errors.spec.ts | 2 +- src/errors/errors.ts | 2 +- src/module.ts | 20 +++++++++---------- src/parser/__tests__/model.spec.ts | 2 +- .../__tests__/ExpressionStep.spec.ts | 2 +- src/parser/models/ScenarioParent.ts | 2 +- src/parser/models/Stepable.ts | 2 +- src/parser/models/index.ts | 4 ++-- src/parser/parser.ts | 6 ++---- src/plugin/__tests__/vitest-plugin.spec.ts | 2 +- src/vitest/__tests__/configuration.spec.ts | 4 ++-- src/vitest/__tests__/describe-feature.spec.ts | 2 +- .../steps/define-step-orders.spec.ts | 4 ++-- .../__tests__/steps/step-context.spec.ts | 2 +- .../__tests__/steps/step-expressions.spec.ts | 2 +- src/vitest/configuration.ts | 6 +----- src/vitest/describe-feature.ts | 2 +- 18 files changed, 36 insertions(+), 42 deletions(-) diff --git a/src/browser/index.ts b/src/browser/index.ts index d97f4e5..f828d51 100644 --- a/src/browser/index.ts +++ b/src/browser/index.ts @@ -1,11 +1,11 @@ export { - type VitestCucumberOptions, + type CustomParameterExpressionArgs, + defineParameterExpression, +} from '../parser/expression/custom' +export type { Currency } from '../parser/expression/regexes' +export { setVitestCucumberConfiguration, + type VitestCucumberOptions, } from '../vitest/configuration' export { describeFeature } from '../vitest/describe-feature' export { loadFeature } from './load-feature' -export type { Currency } from '../parser/expression/regexes' -export { - defineParameterExpression, - type CustomParameterExpressionArgs, -} from '../parser/expression/custom' diff --git a/src/errors/__tests__/errors.spec.ts b/src/errors/__tests__/errors.spec.ts index 268382d..6fe185d 100644 --- a/src/errors/__tests__/errors.spec.ts +++ b/src/errors/__tests__/errors.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { Rule } from '../../parser/models/Rule' import { Feature } from '../../parser/models/feature' +import { Rule } from '../../parser/models/Rule' import { Scenario } from '../../parser/models/scenario' import { BackgroundNotExistsError, NotScenarioOutlineError } from '../errors' diff --git a/src/errors/errors.ts b/src/errors/errors.ts index ab2f619..ec1ebf6 100644 --- a/src/errors/errors.ts +++ b/src/errors/errors.ts @@ -1,8 +1,8 @@ import type { Background } from '../parser/models/Background' +import type { Feature } from '../parser/models/feature' import type { Rule } from '../parser/models/Rule' import type { ScenarioParent } from '../parser/models/ScenarioParent' import type { StepAble } from '../parser/models/Stepable' -import type { Feature } from '../parser/models/feature' import type { Scenario, ScenarioOutline } from '../parser/models/scenario' import type { Step, StepTypes } from '../parser/models/step' diff --git a/src/module.ts b/src/module.ts index 0c7e4d4..ab8ae1e 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,15 +1,15 @@ export { - type VitestCucumberOptions, - setVitestCucumberConfiguration, - getVitestCucumberConfiguration, + type CustomParameterExpressionArgs, + defineParameterExpression, +} from './parser/expression/custom' +export type { Currency } from './parser/expression/regexes' +export { VitestCucumberPlugin } from './plugin/index' +export { defineSteps, + getVitestCucumberConfiguration, + setVitestCucumberConfiguration, + type VitestCucumberOptions, } from './vitest/configuration' export { describeFeature } from './vitest/describe-feature' export { loadFeature } from './vitest/load-feature' -export type { Currency } from './parser/expression/regexes' -export { VitestCucumberPlugin } from './plugin/index' -export { - defineParameterExpression, - type CustomParameterExpressionArgs, -} from './parser/expression/custom' -export { StepTest, FeatureDescriibeCallbackParams } from "./vitest/types" +export { FeatureDescriibeCallbackParams, StepTest } from './vitest/types' diff --git a/src/parser/__tests__/model.spec.ts b/src/parser/__tests__/model.spec.ts index 5a2f07b..2adf841 100644 --- a/src/parser/__tests__/model.spec.ts +++ b/src/parser/__tests__/model.spec.ts @@ -10,8 +10,8 @@ import { RuleNotCalledError, } from '../../errors/errors' import { Background } from '../models/Background' -import { Rule } from '../models/Rule' import { Feature } from '../models/feature' +import { Rule } from '../models/Rule' import { Scenario, ScenarioOutline } from '../models/scenario' import { Step, StepTypes } from '../models/step' diff --git a/src/parser/expression/__tests__/ExpressionStep.spec.ts b/src/parser/expression/__tests__/ExpressionStep.spec.ts index e375136..8f56e96 100644 --- a/src/parser/expression/__tests__/ExpressionStep.spec.ts +++ b/src/parser/expression/__tests__/ExpressionStep.spec.ts @@ -7,8 +7,8 @@ import { StepExpressionMatchError, } from '../../../errors/errors' import { Step, StepTypes } from '../../models/step' -import { ExpressionStep, builtInExpressionRegEx } from '../ExpressionStep' import { customExpressionRegEx, defineParameterExpression } from '../custom' +import { builtInExpressionRegEx, ExpressionStep } from '../ExpressionStep' describe(`ExpressionStep`, () => { describe('{boolean}', () => { diff --git a/src/parser/models/ScenarioParent.ts b/src/parser/models/ScenarioParent.ts index 4202a4e..4d682d8 100644 --- a/src/parser/models/ScenarioParent.ts +++ b/src/parser/models/ScenarioParent.ts @@ -10,8 +10,8 @@ import { } from '../../errors/errors' import type { RequiredDescribeFeatureOptions } from '../../vitest/describe-feature' import type { Background } from './Background' -import { Taggable } from './Taggable' import { type Example, Scenario, ScenarioOutline } from './scenario' +import { Taggable } from './Taggable' export abstract class ScenarioParent extends Taggable { public readonly name: string diff --git a/src/parser/models/Stepable.ts b/src/parser/models/Stepable.ts index 52d9f57..cfe203f 100644 --- a/src/parser/models/Stepable.ts +++ b/src/parser/models/Stepable.ts @@ -5,8 +5,8 @@ import { StepAbleUnknowStepError, } from '../../errors/errors' import { ExpressionStep } from '../expression/ExpressionStep' -import { Taggable } from './Taggable' import { Step, type StepTypes } from './step' +import { Taggable } from './Taggable' export abstract class StepAble extends Taggable { public abstract getTitle(): string diff --git a/src/parser/models/index.ts b/src/parser/models/index.ts index 7d17a73..07d6a1c 100644 --- a/src/parser/models/index.ts +++ b/src/parser/models/index.ts @@ -1,7 +1,7 @@ export * from './Background' export * from './feature' -export * from './ScenarioParent' export * from './feature' +export * from './Rule' +export * from './ScenarioParent' export * from './scenario' export * from './step' -export * from './Rule' diff --git a/src/parser/parser.ts b/src/parser/parser.ts index c6dd105..ebf0004 100644 --- a/src/parser/parser.ts +++ b/src/parser/parser.ts @@ -12,12 +12,12 @@ import type { } from '../vitest/configuration' import { type SpokenParser, SpokenParserFactory } from './lang/SpokenParser' import { Background } from './models/Background' +import { Feature } from './models/feature' import { Rule } from './models/Rule' import type { StepAble } from './models/Stepable' -import type { Taggable } from './models/Taggable' -import { Feature } from './models/feature' import { type Example, Scenario, ScenarioOutline } from './models/scenario' import { Step, type StepDataTanle } from './models/step' +import type { Taggable } from './models/Taggable' type SteppableName = 'Scenario' | 'ScenarioOutline' | 'Background' @@ -322,7 +322,6 @@ export class GherkinParser { // biome-ignore lint/suspicious/noExplicitAny: const res = exampleVariables.reduce((acc: any, cur, index) => { // biome-ignore lint/suspicious/noAssignInExpressions: - // biome-ignore lint/style/noCommaOperator: return (acc[keys[index]] = cur), acc }, {}) @@ -342,7 +341,6 @@ export class GherkinParser { // biome-ignore lint/suspicious/noExplicitAny: const res = this.exampleKeys.reduce((acc: any, cur, index) => { // biome-ignore lint/suspicious/noAssignInExpressions: - // biome-ignore lint/style/noCommaOperator: return (acc[this.exampleKeys[index]] = null), acc }, {}) diff --git a/src/plugin/__tests__/vitest-plugin.spec.ts b/src/plugin/__tests__/vitest-plugin.spec.ts index 92b9dc9..2a4c2dd 100644 --- a/src/plugin/__tests__/vitest-plugin.spec.ts +++ b/src/plugin/__tests__/vitest-plugin.spec.ts @@ -1,9 +1,9 @@ import fs from 'node:fs' import { expect, vi } from 'vitest' import { - VitestCucumberPlugin, describeFeature, loadFeature, + VitestCucumberPlugin, } from '../../../src/module' import { AstUtils } from '../ast/AstUtils' import { getSourceFileFromPath } from './spec-utils' diff --git a/src/vitest/__tests__/configuration.spec.ts b/src/vitest/__tests__/configuration.spec.ts index b6a5d9e..4a29dad 100644 --- a/src/vitest/__tests__/configuration.spec.ts +++ b/src/vitest/__tests__/configuration.spec.ts @@ -1,10 +1,10 @@ -import { type TaskContext, afterEach, describe, expect, it, vi } from 'vitest' +import { afterEach, describe, expect, it, type TaskContext, vi } from 'vitest' import { FeatureContentReader } from '../../__mocks__/FeatureContentReader.spec' import { Step, StepTypes } from '../../parser/models/step' import { - type VitestCucumberOptions, getVitestCucumberConfiguration, setVitestCucumberConfiguration, + type VitestCucumberOptions, } from '../configuration' import { describeFeature } from '../describe-feature' diff --git a/src/vitest/__tests__/describe-feature.spec.ts b/src/vitest/__tests__/describe-feature.spec.ts index a0fbdaa..40d3d4a 100644 --- a/src/vitest/__tests__/describe-feature.spec.ts +++ b/src/vitest/__tests__/describe-feature.spec.ts @@ -14,8 +14,8 @@ import { StepAbleStepsNotCalledError, StepAbleUnknowStepError, } from '../../errors/errors' -import { Rule, Rule as RuleType } from '../../parser/models/Rule' import { Feature } from '../../parser/models/feature' +import { Rule, Rule as RuleType } from '../../parser/models/Rule' import { Scenario as ScenarioType } from '../../parser/models/scenario' import { Step, StepTypes } from '../../parser/models/step' import { describeFeature } from '../describe-feature' diff --git a/src/vitest/__tests__/steps/define-step-orders.spec.ts b/src/vitest/__tests__/steps/define-step-orders.spec.ts index 211d57b..422a2e7 100644 --- a/src/vitest/__tests__/steps/define-step-orders.spec.ts +++ b/src/vitest/__tests__/steps/define-step-orders.spec.ts @@ -1,8 +1,7 @@ -import { type Mock, beforeAll, describe, expect, vi } from 'vitest' +import { beforeAll, describe, expect, type Mock, vi } from 'vitest' import { FeatureContentReader } from '../../../__mocks__/FeatureContentReader.spec' import { Scenario, Step, StepTypes } from '../../../parser/models' import { defineSteps, resetDefinedSteps } from '../../configuration' -import { describeFeature } from '../../describe-feature' import { defineSharedStep, defineStepToTest, @@ -10,6 +9,7 @@ import { updatePredefinedStepsAccordingLevel, } from '../../describe/define-step-test' import type { ScenarioSteps } from '../../describe/types' +import { describeFeature } from '../../describe-feature' describe('defineSteps order', () => { beforeAll(() => { diff --git a/src/vitest/__tests__/steps/step-context.spec.ts b/src/vitest/__tests__/steps/step-context.spec.ts index 3bdf849..0f12a47 100644 --- a/src/vitest/__tests__/steps/step-context.spec.ts +++ b/src/vitest/__tests__/steps/step-context.spec.ts @@ -1,4 +1,4 @@ -import { type Suite, type Task, describe, expect, test, vi } from 'vitest' +import { describe, expect, type Suite, type Task, test, vi } from 'vitest' import { FeatureContentReader } from '../../../__mocks__/FeatureContentReader.spec' import type { ScenarioOutline } from '../../../parser/models/scenario' import { StepTypes } from '../../../parser/models/step' diff --git a/src/vitest/__tests__/steps/step-expressions.spec.ts b/src/vitest/__tests__/steps/step-expressions.spec.ts index e93da26..bd19dc7 100644 --- a/src/vitest/__tests__/steps/step-expressions.spec.ts +++ b/src/vitest/__tests__/steps/step-expressions.spec.ts @@ -1,4 +1,4 @@ -import { type TestContext, describe, expect } from 'vitest' +import { describe, expect, type TestContext } from 'vitest' import { FeatureContentReader } from '../../../__mocks__/FeatureContentReader.spec' import { StepAbleStepExpressionError } from '../../../errors/errors' import type { Currency } from '../../../parser/expression/regexes' diff --git a/src/vitest/configuration.ts b/src/vitest/configuration.ts index 531f05b..0c1fdaf 100644 --- a/src/vitest/configuration.ts +++ b/src/vitest/configuration.ts @@ -17,11 +17,7 @@ export type VitestCucumberOptions = { excludeTags?: TagFilterItem[] predefinedSteps: ScenarioSteps[] mappedExamples: { [key: string]: unknown } - onStepError?: (args: { - error: Error - ctx: TaskContext - step: Step - }) => void + onStepError?: (args: { error: Error; ctx: TaskContext; step: Step }) => void } export type RequiredVitestCucumberOptions = Required diff --git a/src/vitest/describe-feature.ts b/src/vitest/describe-feature.ts index fab5a0e..5d9c6a3 100644 --- a/src/vitest/describe-feature.ts +++ b/src/vitest/describe-feature.ts @@ -1,9 +1,9 @@ import { afterAll, beforeAll, describe } from 'vitest' import { type Example, type Feature, StepTypes } from '../parser/models' import { + getVitestCucumberConfiguration, type TagFilterItem, type VitestCucumberOptions, - getVitestCucumberConfiguration, } from './configuration' import { defineSharedStep, From f473e44e4e37bb305b347fedf6a957af42c4b606 Mon Sep 17 00:00:00 2001 From: amiceli Date: Sun, 20 Jul 2025 16:10:27 +0200 Subject: [PATCH 3/5] chore: lint code with new biome config --- commitlint.config.js | 6 +- scripts/cli.ts | 4 +- scripts/generateFile.ts | 27 ++- src/errors/errors.ts | 14 +- src/parser/__tests__/model.spec.ts | 108 +++++++-- src/parser/__tests__/parser.spec.ts | 66 ++++- src/parser/expression/ExpressionStep.ts | 4 +- .../__tests__/ExpressionStep.spec.ts | 228 ++++++++++++++---- src/parser/lang/SpokenParser.ts | 30 ++- src/parser/models/Background.ts | 5 +- src/plugin/__tests__/lang/lang-ast.spec.ts | 4 +- src/plugin/__tests__/steps/steps-ast.spec.ts | 6 +- src/plugin/__tests__/vitest-plugin.spec.ts | 4 +- src/plugin/index.ts | 56 +++-- src/vitest/__tests__/configuration.spec.ts | 46 +++- src/vitest/__tests__/context/context.spec.ts | 19 +- src/vitest/__tests__/describe-feature.spec.ts | 5 +- src/vitest/__tests__/mapped-variables.spec.ts | 27 ++- .../rule/skip-scenario-outline.spec.ts | 5 +- .../only-skip/skip-scenario-outline.spec.ts | 5 +- .../steps/define-step-orders.spec.ts | 5 +- .../__tests__/steps/define-steps.spec.ts | 5 +- .../__tests__/steps/on-step-error.spec.ts | 30 ++- .../__tests__/tags/exclude-tags.spec.ts | 69 ++++-- src/vitest/__tests__/tags/handle-tags.spec.ts | 86 +++++-- src/vitest/configuration.ts | 8 +- src/vitest/describe-feature.ts | 30 ++- .../describe/__tests__/scenario.spec.ts | 9 +- src/vitest/describe/describe-background.ts | 5 +- .../describe/describe-scenario-outline.ts | 13 +- src/vitest/describe/describe-scenario.ts | 5 +- src/vitest/describe/types.ts | 5 +- vitest.config.ts | 4 +- 33 files changed, 717 insertions(+), 226 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index 4fedde6..fbbb777 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,5 @@ -module.exports = { extends: ['@commitlint/config-conventional'] } +module.exports = { + extends: [ + '@commitlint/config-conventional', + ], +} diff --git a/scripts/cli.ts b/scripts/cli.ts index a2dab78..7e4c868 100644 --- a/scripts/cli.ts +++ b/scripts/cli.ts @@ -16,7 +16,9 @@ if (!spec) { process.exit(-1) } -loadFeature(feature, { language: lang || 'en' }).then((f) => { +loadFeature(feature, { + language: lang || 'en', +}).then((f) => { writeSpecFile({ feature: f, featureFilePath: feature, diff --git a/scripts/generateFile.ts b/scripts/generateFile.ts index c53b66f..b5ff51d 100644 --- a/scripts/generateFile.ts +++ b/scripts/generateFile.ts @@ -15,7 +15,9 @@ export function generateScenarii( scenarii: Feature['scenarii'], forRule = false, ) { - const fileContent = [''] + const fileContent = [ + '', + ] for (const scenario of scenarii) { const isOutline = scenario instanceof ScenarioOutline @@ -60,13 +62,20 @@ export function generateScenarii( } export function generateBackground(back: Background, forRule = false) { - const fileContent = [''] + const fileContent = [ + '', + ] - const scenarioStepTypes = ['Given', 'When', 'Then', 'And', 'But'].filter( - (step) => - back.steps - .map((scenarioSteps) => scenarioSteps.type.toString()) - .includes(step), + const scenarioStepTypes = [ + 'Given', + 'When', + 'Then', + 'And', + 'But', + ].filter((step) => + back.steps + .map((scenarioSteps) => scenarioSteps.type.toString()) + .includes(step), ) const scenarioType = forRule ? 'RuleBackground' : 'Background' @@ -140,7 +149,9 @@ export async function writeSpecFile({ 'BeforeEachScenario', 'AfterEachScenario', ] - const describeFeatureArgs = [...describeHook] + const describeFeatureArgs = [ + ...describeHook, + ] if (featureHasBackground) { describeFeatureArgs.push('Background') } diff --git a/src/errors/errors.ts b/src/errors/errors.ts index ec1ebf6..1686348 100644 --- a/src/errors/errors.ts +++ b/src/errors/errors.ts @@ -195,9 +195,10 @@ export class MissingScnearioOutlineError extends VitestsCucumberError { export class MissingExamplesError extends VitestsCucumberError { public constructor(line: string) { super( - [`Missing Examples before add value`, ` ${line.trim()} ❌`].join( - '\n', - ), + [ + `Missing Examples before add value`, + ` ${line.trim()} ❌`, + ].join('\n'), ) } } @@ -260,6 +261,11 @@ export class ItemAlreadyExistsError extends VitestsCucumberError { export class RequiredTitleError extends VitestsCucumberError { public constructor(line: string, keyword: string) { - super([`${line} ❌`, ` ${keyword} required a title`].join('\n')) + super( + [ + `${line} ❌`, + ` ${keyword} required a title`, + ].join('\n'), + ) } } diff --git a/src/parser/__tests__/model.spec.ts b/src/parser/__tests__/model.spec.ts index 2adf841..d1b8377 100644 --- a/src/parser/__tests__/model.spec.ts +++ b/src/parser/__tests__/model.spec.ts @@ -55,7 +55,14 @@ describe(`Models`, () => { expect(outline.missingExamplesKeyword).toBeFalsy() expect(outline.examples).toEqual([]) - outline.examples = [{ test: [`yes`, `no`] }] + outline.examples = [ + { + test: [ + `yes`, + `no`, + ], + }, + ] feature.addScenario(scenario) feature.addScenario(outline) @@ -98,7 +105,9 @@ describe(`Models`, () => { expect( feature.getFirstRuleNotCalled({ includeTags: [], - excludeTags: [`ignore`], + excludeTags: [ + `ignore`, + ], }), ).toBeUndefined() @@ -128,13 +137,17 @@ describe(`Models`, () => { expect(() => { feature.checkUncalledRule({ includeTags: [], - excludeTags: [`test`], + excludeTags: [ + `test`, + ], }) }).toThrowError(new RuleNotCalledError(rule)) expect(() => { feature.checkUncalledRule({ - includeTags: [`ignore`], + includeTags: [ + `ignore`, + ], excludeTags: [], }) }).toThrowError(new RuleNotCalledError(rule)) @@ -142,7 +155,9 @@ describe(`Models`, () => { expect(() => { feature.checkUncalledRule({ includeTags: [], - excludeTags: [`ignore`], + excludeTags: [ + `ignore`, + ], }) }).not.toThrowError() @@ -299,7 +314,14 @@ describe(`Models`, () => { expect(outline.missingExamplesKeyword).toBeFalsy() expect(outline.examples).toEqual([]) - outline.examples = [{ test: [`yes`, `no`] }] + outline.examples = [ + { + test: [ + `yes`, + `no`, + ], + }, + ] rule.addScenario(scenario) rule.addScenario(outline) @@ -428,7 +450,9 @@ describe(`Models`, () => { test(`Scenario Outline can replace example in step title`, () => { const step = new Step(StepTypes?.GIVEN, `I use `) const scenarioOutline = new ScenarioOutline(`outline`) - const example = { framework: `Vue` } + const example = { + framework: `Vue`, + } expect(scenarioOutline.getStepTitle(step, example)).toEqual( `Given I use Vue`, @@ -461,40 +485,86 @@ describe(`Models`, () => { describe('scenario without tag', () => { test(`false if not present`, () => { - expect(scenario.matchTags([`test`])).toBe(false) + expect( + scenario.matchTags([ + `test`, + ]), + ).toBe(false) }) }) describe('scenario with a single tag', () => { - scenario.tags = new Set([`vitests`]) + scenario.tags = new Set([ + `vitests`, + ]) test(`false if not matching`, () => { - expect(scenario.matchTags([`test`])).toBe(false) + expect( + scenario.matchTags([ + `test`, + ]), + ).toBe(false) }) test(`true if one tag matches`, () => { - expect(scenario.matchTags([`vitests`, `another`])).toBe(true) + expect( + scenario.matchTags([ + `vitests`, + `another`, + ]), + ).toBe(true) }) }) describe('scenario with multiple tags', () => { - scenario.tags = new Set([`vitests`, `another`]) + scenario.tags = new Set([ + `vitests`, + `another`, + ]) test(`true if at least one tag matches`, () => { - expect(scenario.matchTags([`vitests`, `test`])).toBe(true) + expect( + scenario.matchTags([ + `vitests`, + `test`, + ]), + ).toBe(true) }) test(`true if all tags matches`, () => { - expect(scenario.matchTags([`vitests`, `another`])).toBe(true) + expect( + scenario.matchTags([ + `vitests`, + `another`, + ]), + ).toBe(true) }) test(`false if no tag match`, () => { - expect(scenario.matchTags([`test`])).toBe(false) + expect( + scenario.matchTags([ + `test`, + ]), + ).toBe(false) }) test(`false if 'AND' operation does not match`, () => { - const operation = [`vitests`, `test`] - expect(scenario.matchTags([operation])).toBe(false) + const operation = [ + `vitests`, + `test`, + ] + expect( + scenario.matchTags([ + operation, + ]), + ).toBe(false) }) test(`true if 'AND' operation does match`, () => { - const operation = [`vitests`, `another`] - expect(scenario.matchTags([operation])).toBe(true) + const operation = [ + `vitests`, + `another`, + ] + expect( + scenario.matchTags([ + operation, + ]), + ).toBe(true) }) }) }) diff --git a/src/parser/__tests__/parser.spec.ts b/src/parser/__tests__/parser.spec.ts index 241d02c..b700ebf 100644 --- a/src/parser/__tests__/parser.spec.ts +++ b/src/parser/__tests__/parser.spec.ts @@ -389,8 +389,20 @@ describe(`GherkinParser`, () => { const [oneTag, manyLineTags, oneLineTags] = currentFeature.scenarii expect(oneTag.tags).toContain(`example`) - expect([...manyLineTags.tags]).toEqual([`example`, `awesome`, `again`]) - expect([...oneLineTags.tags]).toEqual([`example`, `awesome`, `again`]) + expect([ + ...manyLineTags.tags, + ]).toEqual([ + `example`, + `awesome`, + `again`, + ]) + expect([ + ...oneLineTags.tags, + ]).toEqual([ + `example`, + `awesome`, + `again`, + ]) }) it(`should ignore tags without @`, () => { @@ -405,7 +417,12 @@ describe(`GherkinParser`, () => { const [noTag, twoTags] = currentFeature.scenarii expect(noTag.tags.size).toBe(0) - expect([...twoTags.tags]).toEqual([`example`, `again`]) + expect([ + ...twoTags.tags, + ]).toEqual([ + `example`, + `again`, + ]) }) it(`should be able to add tag to Feature`, () => { @@ -655,7 +672,11 @@ describe(`GherkinParser`, () => { }) describe('GherkinParser - language', () => { - const langs = ['fr', 'it', 'sr-Latn'] + const langs = [ + 'fr', + 'it', + 'sr-Latn', + ] for (const language of langs) { const languageKeys = avalaibleLanguages[language] @@ -663,7 +684,9 @@ describe('GherkinParser - language', () => { describe(`GherkinParser - language - ${language}`, () => { for (const featureKey of languageKeys.feature) { test(`${language} - Feature - ${featureKey}`, () => { - const parser = new GherkinParser({ language }) + const parser = new GherkinParser({ + language, + }) parser.addLine(`${featureKey}: allez l'OM`) @@ -674,7 +697,9 @@ describe('GherkinParser - language', () => { for (const scenarioKey of languageKeys.scenario) { const [featureKey] = languageKeys.feature test(`${language} - Scenario - ${scenarioKey}`, () => { - const parser = new GherkinParser({ language }) + const parser = new GherkinParser({ + language, + }) parser.addLine(`${featureKey}: allez l'OM`) parser.addLine(`${scenarioKey}: gagner le match`) @@ -689,7 +714,9 @@ describe('GherkinParser - language', () => { for (const outlineKey of languageKeys.scenarioOutline) { const [featureKey] = languageKeys.feature test(`${language} - ScenarioOutline - ${outlineKey}`, () => { - const parser = new GherkinParser({ language }) + const parser = new GherkinParser({ + language, + }) parser.addLine(`${featureKey}: allez l'OM`) parser.addLine(`${outlineKey}: gagner le match`) @@ -705,7 +732,9 @@ describe('GherkinParser - language', () => { for (const outlineKey of languageKeys.rule) { const [featureKey] = languageKeys.feature test(`${language} - Rule - ${outlineKey}`, () => { - const parser = new GherkinParser({ language }) + const parser = new GherkinParser({ + language, + }) parser.addLine(`${featureKey}: allez l'OM`) parser.addLine(`${outlineKey}: En lique 1`) @@ -738,14 +767,23 @@ describe('GherkinParser - language', () => { expect( (scenarioOutline as ScenarioOutline).examples, - ).toEqual([{ test: 'one' }, { test: 'two' }]) + ).toEqual([ + { + test: 'one', + }, + { + test: 'two', + }, + ]) }) } for (const backgroundKey of languageKeys.background) { const [featureKey] = languageKeys.feature test(`${language} - Background - ${backgroundKey}`, () => { - const parser = new GherkinParser({ language }) + const parser = new GherkinParser({ + language, + }) parser.addLine(`${featureKey}: allez l'OM`) parser.addLine(`${backgroundKey}:`) @@ -770,7 +808,9 @@ describe('GherkinParser - language', () => { const [andKey] = languageKeys.and.filter((v: string) => v !== '* ') const [butKey] = languageKeys.but.filter((v: string) => v !== '* ') - const parser = new GherkinParser({ language }) + const parser = new GherkinParser({ + language, + }) parser.addLine(`${featureKey}: check GherkinParser`) parser.addLine(`${scenarioKey}: I use ${language} lang`) @@ -925,7 +965,9 @@ describe('Gherkin Parse - DocStrings && ExpressionStep && DataTables', () => { ` | two |`, ]).parseContent() - type GivenStepTables = { test: string } + type GivenStepTables = { + test: string + } describeFeature(feature, (f) => { f.Scenario('DocStrings & DataTables', (s) => { diff --git a/src/parser/expression/ExpressionStep.ts b/src/parser/expression/ExpressionStep.ts index ed0f5ec..1b294b2 100644 --- a/src/parser/expression/ExpressionStep.ts +++ b/src/parser/expression/ExpressionStep.ts @@ -72,7 +72,9 @@ export class ExpressionStep { regexString = `^${regexString}$` const regex = new RegExp(regexString, `g`) - const matches = [...step.details.matchAll(regex)] + const matches = [ + ...step.details.matchAll(regex), + ] const result = matches.map((match) => { const res: Array<{ diff --git a/src/parser/expression/__tests__/ExpressionStep.spec.ts b/src/parser/expression/__tests__/ExpressionStep.spec.ts index 8f56e96..20b503d 100644 --- a/src/parser/expression/__tests__/ExpressionStep.spec.ts +++ b/src/parser/expression/__tests__/ExpressionStep.spec.ts @@ -18,7 +18,9 @@ describe(`ExpressionStep`, () => { step, `This information is {boolean}`, ) - expect(params).toEqual([true]) + expect(params).toEqual([ + true, + ]) }) it(`should match multiple {boolean}`, () => { @@ -27,7 +29,10 @@ describe(`ExpressionStep`, () => { step, `Is it {boolean} or {boolean}?`, ) - expect(params).toEqual([true, false]) + expect(params).toEqual([ + true, + false, + ]) }) it(`should not match {boolean} that start with expected keyword`, () => { @@ -50,7 +55,9 @@ describe(`ExpressionStep`, () => { step, `This is a {word} reward`, ) - expect(params).toEqual([`special`]) + expect(params).toEqual([ + `special`, + ]) }) it(`should match multiple {word}`, () => { @@ -59,7 +66,10 @@ describe(`ExpressionStep`, () => { step, `Either a {word} or a {word}`, ) - expect(params).toEqual([`book`, `movie`]) + expect(params).toEqual([ + `book`, + `movie`, + ]) }) }) @@ -70,7 +80,9 @@ describe(`ExpressionStep`, () => { step, `I got an {char} grade`, ) - expect(params).toEqual([`A`]) + expect(params).toEqual([ + `A`, + ]) }) it(`should match multiple {char}`, () => { @@ -82,7 +94,10 @@ describe(`ExpressionStep`, () => { step, `A grade between {char} and {char} is required to pass the exam`, ) - expect(params).toEqual([`A`, `C`]) + expect(params).toEqual([ + `A`, + `C`, + ]) }) it(`should match {char} inside a word`, () => { @@ -94,7 +109,9 @@ describe(`ExpressionStep`, () => { step, `should be the 7th char of the word "Alphab{char}t"`, ) - expect(params).toEqual([`e`]) + expect(params).toEqual([ + `e`, + ]) }) it(`should match consecutive {char}`, () => { @@ -103,7 +120,12 @@ describe(`ExpressionStep`, () => { step, `{char}{char}{char}{char}`, ) - expect(params).toEqual([`A`, `T`, `C`, `G`]) + expect(params).toEqual([ + `A`, + `T`, + `C`, + `G`, + ]) }) }) @@ -111,7 +133,9 @@ describe(`ExpressionStep`, () => { it(`should match {string}`, () => { const step = new Step(StepTypes.GIVEN, `I love 'Vue'`) const params = ExpressionStep.matchStep(step, `I love {string}`) - expect(params).toEqual([`Vue`]) + expect(params).toEqual([ + `Vue`, + ]) }) it(`should match multiple {string}`, () => { @@ -120,7 +144,10 @@ describe(`ExpressionStep`, () => { step, `I love {string} for {string}`, ) - expect(params).toEqual([`Vue`, `web`]) + expect(params).toEqual([ + `Vue`, + `web`, + ]) }) }) @@ -134,7 +161,9 @@ describe(`ExpressionStep`, () => { step, `This message will be sent to {email}`, ) - expect(params).toEqual([`john.smith@example.com`]) + expect(params).toEqual([ + `john.smith@example.com`, + ]) }) it(`should match multiple {email}`, () => { @@ -181,7 +210,9 @@ describe(`ExpressionStep`, () => { step, `I visit the page {url}`, ) - expect(params).toEqual([new URL('http://localhost:8080')]) + expect(params).toEqual([ + new URL('http://localhost:8080'), + ]) }) it(`should match multiple {url}`, () => { @@ -208,7 +239,9 @@ describe(`ExpressionStep`, () => { step, `I visit the page {url}`, ) - expect(params).toEqual([new URL('ws://localhost:8080')]) + expect(params).toEqual([ + new URL('ws://localhost:8080'), + ]) }) it(`should fail to match {url}`, () => { @@ -224,7 +257,9 @@ describe(`ExpressionStep`, () => { it(`should match {int}`, () => { const step = new Step(StepTypes.GIVEN, `I love Vue 3`) const params = ExpressionStep.matchStep(step, `I love Vue {int}`) - expect(params).toEqual([3]) + expect(params).toEqual([ + 3, + ]) }) it(`should match multiple {int}`, () => { @@ -233,7 +268,10 @@ describe(`ExpressionStep`, () => { step, `I love Vue {int} or {int}`, ) - expect(params).toEqual([2, 3]) + expect(params).toEqual([ + 2, + 3, + ]) }) it(`should fail to match {int}`, () => { @@ -249,7 +287,9 @@ describe(`ExpressionStep`, () => { it(`should match negative {int}`, () => { const step = new Step(StepTypes.GIVEN, `It is cold. -14°C`) const params = ExpressionStep.matchStep(step, `It is cold. {int}°C`) - expect(params).toEqual([-14]) + expect(params).toEqual([ + -14, + ]) }) }) @@ -257,7 +297,9 @@ describe(`ExpressionStep`, () => { it(`should match {number}`, () => { const step = new Step(StepTypes.GIVEN, `I love Vue 3.1`) const params = ExpressionStep.matchStep(step, `I love Vue {number}`) - expect(params).toEqual([3.1]) + expect(params).toEqual([ + 3.1, + ]) }) it(`should match multiple {number}`, () => { @@ -266,13 +308,18 @@ describe(`ExpressionStep`, () => { step, `I love Vue {number} or {number}`, ) - expect(params).toEqual([3.1, 3.2]) + expect(params).toEqual([ + 3.1, + 3.2, + ]) }) it(`should match integer {number}`, () => { const step = new Step(StepTypes.GIVEN, `I love Vue 3`) const params = ExpressionStep.matchStep(step, `I love Vue {number}`) - expect(params).toEqual([3]) + expect(params).toEqual([ + 3, + ]) }) it(`should match negative {number}`, () => { @@ -281,7 +328,9 @@ describe(`ExpressionStep`, () => { step, `It is cold. {number}°C`, ) - expect(params).toEqual([-4.73]) + expect(params).toEqual([ + -4.73, + ]) }) }) @@ -296,7 +345,9 @@ describe(`ExpressionStep`, () => { step, `the order was created at {date}`, ) - expect(params).toEqual([new Date(2022, 11, 1)]) + expect(params).toEqual([ + new Date(2022, 11, 1), + ]) }) it(`should match multiple {date}`, () => { @@ -327,7 +378,9 @@ describe(`ExpressionStep`, () => { step, `the order was created at {date}`, ) - expect(params).toEqual([new Date(Date.UTC(2022, 11, 1))]) + expect(params).toEqual([ + new Date(Date.UTC(2022, 11, 1)), + ]) }) it(`should match multiple {date}`, () => { @@ -356,7 +409,9 @@ describe(`ExpressionStep`, () => { step, `The log was created at {date}`, ) - expect(params).toEqual([new Date(2017, 4, 23, 15, 2, 27)]) + expect(params).toEqual([ + new Date(2017, 4, 23, 15, 2, 27), + ]) }) }) @@ -370,7 +425,9 @@ describe(`ExpressionStep`, () => { step, `The log was created at {date}`, ) - expect(params).toEqual([new Date(2017, 4, 23, 15, 2, 27)]) + expect(params).toEqual([ + new Date(2017, 4, 23, 15, 2, 27), + ]) }) it(`should match {date} with UTC timezone`, () => { @@ -420,19 +477,25 @@ describe(`ExpressionStep`, () => { it(`should match {date}`, () => { const step = new Step(StepTypes.GIVEN, `today is Jan 25 2015`) const params = ExpressionStep.matchStep(step, `today is {date}`) - expect(params).toEqual([new Date(2015, 0, 25)]) + expect(params).toEqual([ + new Date(2015, 0, 25), + ]) }) it(`should match {date} starting with day`, () => { const step = new Step(StepTypes.GIVEN, `today is 03 Mar 2016`) const params = ExpressionStep.matchStep(step, `today is {date}`) - expect(params).toEqual([new Date(2016, 2, 3)]) + expect(params).toEqual([ + new Date(2016, 2, 3), + ]) }) it(`should match {date} with optional commas`, () => { const step = new Step(StepTypes.GIVEN, `today is Jan, 25, 2015`) const params = ExpressionStep.matchStep(step, `today is {date}`) - expect(params).toEqual([new Date(2015, 0, 25)]) + expect(params).toEqual([ + new Date(2015, 0, 25), + ]) }) }) @@ -443,13 +506,17 @@ describe(`ExpressionStep`, () => { `today is January 25 2015`, ) const params = ExpressionStep.matchStep(step, `today is {date}`) - expect(params).toEqual([new Date(2015, 0, 25)]) + expect(params).toEqual([ + new Date(2015, 0, 25), + ]) }) it(`should match {date} starting with day`, () => { const step = new Step(StepTypes.GIVEN, `today is 03 March 2016`) const params = ExpressionStep.matchStep(step, `today is {date}`) - expect(params).toEqual([new Date(2016, 2, 3)]) + expect(params).toEqual([ + new Date(2016, 2, 3), + ]) }) it(`should match {date} with optional commas`, () => { @@ -458,7 +525,9 @@ describe(`ExpressionStep`, () => { `today is January, 25, 2015`, ) const params = ExpressionStep.matchStep(step, `today is {date}`) - expect(params).toEqual([new Date(2015, 0, 25)]) + expect(params).toEqual([ + new Date(2015, 0, 25), + ]) }) }) @@ -489,7 +558,9 @@ describe(`ExpressionStep`, () => { value: 200, } - expect(params).toEqual([parsedValue]) + expect(params).toEqual([ + parsedValue, + ]) }) it(`should match multiple {number}`, () => { @@ -510,7 +581,10 @@ describe(`ExpressionStep`, () => { value: 3, } - expect(params).toEqual([parsedValue1, parsedValue2]) + expect(params).toEqual([ + parsedValue1, + parsedValue2, + ]) }) it(`should match negative {currency}`, () => { @@ -525,7 +599,9 @@ describe(`ExpressionStep`, () => { value: -50, } - expect(params).toEqual([parsedValue]) + expect(params).toEqual([ + parsedValue, + ]) }) }) @@ -536,9 +612,15 @@ describe(`ExpressionStep`, () => { `I use React, Astro, TypeScript`, ) const params = ExpressionStep.matchStep(step, `I use {list}`) - const expectedList = ['React', 'Astro', 'TypeScript'] + const expectedList = [ + 'React', + 'Astro', + 'TypeScript', + ] - expect(params).toEqual([expectedList]) + expect(params).toEqual([ + expectedList, + ]) }) it(`should match multiple {list}`, () => { @@ -550,14 +632,32 @@ describe(`ExpressionStep`, () => { step, `I use {list} and I also use {list}`, ) - const expectedList1 = ['React', 'Astro', 'TypeScript'] - const expectedList2 = ['Vue', 'Svelte', 'Angular'] + const expectedList1 = [ + 'React', + 'Astro', + 'TypeScript', + ] + const expectedList2 = [ + 'Vue', + 'Svelte', + 'Angular', + ] - expect(params).toEqual([expectedList1, expectedList2]) + expect(params).toEqual([ + expectedList1, + expectedList2, + ]) }) describe('with weparators', () => { - const separators = ["';'", '"/"', "':'", '"_"', "' '", "'-'"] + const separators = [ + "';'", + '"/"', + "':'", + '"_"', + "' '", + "'-'", + ] for (const separator of separators) { it(`should match {list} with separator - {list:${separator}}`, () => { @@ -570,8 +670,14 @@ describe(`ExpressionStep`, () => { step, `I read line {list:${separator}}`, ) - const expectedList = ['id', 'name', 'city'] - expect(params).toEqual([expectedList]) + const expectedList = [ + 'id', + 'name', + 'city', + ] + expect(params).toEqual([ + expectedList, + ]) }) } }) @@ -585,10 +691,21 @@ describe(`ExpressionStep`, () => { step, `I use {list} and I also use {list:";"}`, ) - const expectedList1 = ['React', 'Astro', 'TypeScript'] - const expectedList2 = ['Vue', 'Svelte', 'Angular'] + const expectedList1 = [ + 'React', + 'Astro', + 'TypeScript', + ] + const expectedList2 = [ + 'Vue', + 'Svelte', + 'Angular', + ] - expect(params).toEqual([expectedList1, expectedList2]) + expect(params).toEqual([ + expectedList1, + expectedList2, + ]) }) }) @@ -600,7 +717,9 @@ describe(`ExpressionStep`, () => { ) const params = ExpressionStep.matchStep(step, `should catch {any}`) - expect(params).toEqual([`the rest of the string`]) + expect(params).toEqual([ + `the rest of the string`, + ]) }) it(`should match {any} within text`, () => { @@ -613,7 +732,9 @@ describe(`ExpressionStep`, () => { `should catch {any} of the string`, ) - expect(params).toEqual([`a single part`]) + expect(params).toEqual([ + `a single part`, + ]) }) }) @@ -623,7 +744,11 @@ describe(`ExpressionStep`, () => { step, `I love {string} {number} and {number}`, ) - expect(params).toEqual([`Vue`, 3, 12]) + expect(params).toEqual([ + `Vue`, + 3, + 12, + ]) }) it(`should detect wrong expression`, () => { @@ -704,7 +829,9 @@ describe(`ExpressionStep`, () => { step, `My favorite color is {color}`, ) - expect(params).toEqual([`red`]) + expect(params).toEqual([ + `red`, + ]) }) it(`should match multiple {color}`, () => { @@ -718,7 +845,10 @@ describe(`ExpressionStep`, () => { step, `The english flag has both {color} and {color} colors`, ) - expect(params).toEqual([`red`, `blue`]) + expect(params).toEqual([ + `red`, + `blue`, + ]) }) it(`should fail to match {color} expression`, () => { diff --git a/src/parser/lang/SpokenParser.ts b/src/parser/lang/SpokenParser.ts index 0e61796..409d1e1 100644 --- a/src/parser/lang/SpokenParser.ts +++ b/src/parser/lang/SpokenParser.ts @@ -5,7 +5,10 @@ import availableLanguages from './lang.json' type Languages = keyof typeof availableLanguages type GherkinLanguageDetails = (typeof availableLanguages)['en'] -type LineDetails = { keyword: string; title: string } +type LineDetails = { + keyword: string + title: string +} // biome-ignore lint/complexity/noStaticOnlyClass: export abstract class SpokenParserFactory { @@ -169,11 +172,26 @@ export class SpokenParser { private get stepsMatch(): SpokenStepMatch { return [ - { type: StepTypes.GIVEN, keys: this.details.given }, - { type: StepTypes.WHEN, keys: this.details.when }, - { type: StepTypes.THEN, keys: this.details.then }, - { type: StepTypes.AND, keys: this.details.and }, - { type: StepTypes.BUT, keys: this.details.but }, + { + type: StepTypes.GIVEN, + keys: this.details.given, + }, + { + type: StepTypes.WHEN, + keys: this.details.when, + }, + { + type: StepTypes.THEN, + keys: this.details.then, + }, + { + type: StepTypes.AND, + keys: this.details.and, + }, + { + type: StepTypes.BUT, + keys: this.details.but, + }, ] } } diff --git a/src/parser/models/Background.ts b/src/parser/models/Background.ts index e3e2a1b..5164b1f 100644 --- a/src/parser/models/Background.ts +++ b/src/parser/models/Background.ts @@ -2,7 +2,10 @@ import { NotAllowedBackgroundStepTypeError } from '../../errors/errors' import { StepAble } from './Stepable' import { type Step, StepTypes } from './step' -const BackgroundAllowedSteps = [StepTypes.GIVEN, StepTypes.AND] +const BackgroundAllowedSteps = [ + StepTypes.GIVEN, + StepTypes.AND, +] export class Background extends StepAble { public constructor(title: string = 'Background') { diff --git a/src/plugin/__tests__/lang/lang-ast.spec.ts b/src/plugin/__tests__/lang/lang-ast.spec.ts index 5cbf0f6..0310449 100644 --- a/src/plugin/__tests__/lang/lang-ast.spec.ts +++ b/src/plugin/__tests__/lang/lang-ast.spec.ts @@ -11,7 +11,9 @@ import { getSourceFileFromPath } from '../spec-utils' const feature = await loadFeature( 'src/plugin/__tests__/lang/lang-ast.feature', - { language: 'fr' }, + { + language: 'fr', + }, ) describeFeature( diff --git a/src/plugin/__tests__/steps/steps-ast.spec.ts b/src/plugin/__tests__/steps/steps-ast.spec.ts index c478663..e1e0fa5 100644 --- a/src/plugin/__tests__/steps/steps-ast.spec.ts +++ b/src/plugin/__tests__/steps/steps-ast.spec.ts @@ -131,7 +131,11 @@ describeFeature( getScenarioArgument(specFilePath, scenarioName), ).toContain(type) - for (const stepType of ['Given', 'When', type]) { + for (const stepType of [ + 'Given', + 'When', + type, + ]) { expect( AstUtils.fromSourceFile( getSourceFileFromPath(specFilePath), diff --git a/src/plugin/__tests__/vitest-plugin.spec.ts b/src/plugin/__tests__/vitest-plugin.spec.ts index 2a4c2dd..ba0c669 100644 --- a/src/plugin/__tests__/vitest-plugin.spec.ts +++ b/src/plugin/__tests__/vitest-plugin.spec.ts @@ -25,7 +25,9 @@ describeFeature(feature, (f) => { } as any s.Given("{string} doesn't exists", (_, specPath: string) => { - fs.rmSync(specPath, { force: true }) + fs.rmSync(specPath, { + force: true, + }) }) s.When( 'I write {string}', diff --git a/src/plugin/index.ts b/src/plugin/index.ts index c4849af..1bb875f 100644 --- a/src/plugin/index.ts +++ b/src/plugin/index.ts @@ -18,35 +18,41 @@ export function VitestCucumberPlugin(options: VitestCucumberPluginOptions) { options.featureFilesDir, ) - fs.watch(featureDir, { recursive: true }, async (_, filename) => { - if (filename?.endsWith('.feature')) { - const featureFilePath = `${options.featureFilesDir}${filename}` - const specFilePath = featureFilePath.replace( - '.feature', - '.spec.ts', - ) + fs.watch( + featureDir, + { + recursive: true, + }, + async (_, filename) => { + if (filename?.endsWith('.feature')) { + const featureFilePath = `${options.featureFilesDir}${filename}` + const specFilePath = featureFilePath.replace( + '.feature', + '.spec.ts', + ) - try { - if (fs.existsSync(specFilePath) === false) { - fs.writeFileSync(specFilePath, '') + try { + if (fs.existsSync(specFilePath) === false) { + fs.writeFileSync(specFilePath, '') + } + + await FeatureAst.fromOptions({ + featureFilePath, + specFilePath, + onDeleteAction: options.onDeleteAction, + formatCommand: options.formatCommand, + }).updateSpecFile() + } catch (e) { + console.error(e) } - await FeatureAst.fromOptions({ - featureFilePath, - specFilePath, - onDeleteAction: options.onDeleteAction, - formatCommand: options.formatCommand, - }).updateSpecFile() - } catch (e) { - console.error(e) + server.ws.send({ + type: 'full-reload', + path: '*', + }) } - - server.ws.send({ - type: 'full-reload', - path: '*', - }) - } - }) + }, + ) }, } } diff --git a/src/vitest/__tests__/configuration.spec.ts b/src/vitest/__tests__/configuration.spec.ts index 4a29dad..a8b8570 100644 --- a/src/vitest/__tests__/configuration.spec.ts +++ b/src/vitest/__tests__/configuration.spec.ts @@ -26,9 +26,9 @@ describe(`Ignore scenario with @ignore tag by default`, () => { feature.getScenarioByName(`Ignored scenario`)?.isCalled, ).toBe(false) expect( - feature - .getScenarioByName(`Ignored scenario`) - ?.matchTags([`ignore`]), + feature.getScenarioByName(`Ignored scenario`)?.matchTags([ + `ignore`, + ]), ).toBe(true) }) Scenario(`Simple scenario`, ({ Given, Then }) => { @@ -43,7 +43,9 @@ describe('getVitestCucumberConfiguration', () => { expect(getVitestCucumberConfiguration()).toEqual({ language: 'en', includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], onStepError: expect.any(Function), predefinedSteps: [], mappedExamples: {}, @@ -55,8 +57,12 @@ describe('getVitestCucumberConfiguration', () => { const config = { language: 'fr', - includeTags: ['alpha'], - excludeTags: ['beta'], + includeTags: [ + 'alpha', + ], + excludeTags: [ + 'beta', + ], onStepError: fn, } @@ -69,8 +75,12 @@ describe('getVitestCucumberConfiguration', () => { expect(newConfig).toEqual({ language: 'fr', - includeTags: ['alpha'], - excludeTags: ['beta'], + includeTags: [ + 'alpha', + ], + excludeTags: [ + 'beta', + ], onStepError: expect.any(Function), predefinedSteps: [], mappedExamples: {}, @@ -88,7 +98,9 @@ describe('setVitestCucumberConfiguration', () => { expect(getVitestCucumberConfiguration()).toEqual({ language: 'en', includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], onStepError: expect.any(Function), predefinedSteps: [], mappedExamples: {}, @@ -98,7 +110,9 @@ describe('setVitestCucumberConfiguration', () => { it('custom configuration', () => { const config = { language: 'fr', - excludeTags: ['beta'], + excludeTags: [ + 'beta', + ], } as VitestCucumberOptions setVitestCucumberConfiguration(config) @@ -106,7 +120,9 @@ describe('setVitestCucumberConfiguration', () => { expect(getVitestCucumberConfiguration()).toEqual({ language: 'fr', includeTags: [], - excludeTags: ['beta'], + excludeTags: [ + 'beta', + ], onStepError: expect.any(Function), predefinedSteps: [], mappedExamples: {}, @@ -116,7 +132,9 @@ describe('setVitestCucumberConfiguration', () => { it('override configuration defaults to empty configuration', () => { const fn = vi.fn() const config1 = { - excludeTags: ['beta'], + excludeTags: [ + 'beta', + ], onStepError: fn, } @@ -143,7 +161,9 @@ describe('setVitestCucumberConfiguration', () => { expect(lastConfiguration).toEqual({ language: 'fr', includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], onStepError: expect.any(Function), predefinedSteps: [], mappedExamples: {}, diff --git a/src/vitest/__tests__/context/context.spec.ts b/src/vitest/__tests__/context/context.spec.ts index 6fb3c21..7aea807 100644 --- a/src/vitest/__tests__/context/context.spec.ts +++ b/src/vitest/__tests__/context/context.spec.ts @@ -71,7 +71,11 @@ describe('Feature.context', () => { describeFeature( feature, - (f: FeatureDescriibeCallbackParams<{ value: number }>) => { + ( + f: FeatureDescriibeCallbackParams<{ + value: number + }>, + ) => { f.BeforeAllScenarios(() => { f.context.value = 0 }) @@ -79,7 +83,9 @@ describe('Feature.context', () => { f.context.value += 1 }) f.AfterAllScenarios(() => { - expect(f.context).toEqual({ value: 2 }) + expect(f.context).toEqual({ + value: 2, + }) }) f.Background((b) => { b.Given('I have a feature-background context', () => { @@ -93,8 +99,13 @@ describe('Feature.context', () => { r.context.isRule = true }) - type Variables = { name: string; value: string } - type CustomContext = { name: string } + type Variables = { + name: string + value: string + } + type CustomContext = { + name: string + } r.RuleScenarioOutline( 'use scenario context', (s: StepTest, variables) => { diff --git a/src/vitest/__tests__/describe-feature.spec.ts b/src/vitest/__tests__/describe-feature.spec.ts index 40d3d4a..4748016 100644 --- a/src/vitest/__tests__/describe-feature.spec.ts +++ b/src/vitest/__tests__/describe-feature.spec.ts @@ -555,7 +555,10 @@ describe('use language for feature', () => { f.Rule('utiliser des plans de scénario', (r) => { r.RuleScenarioOutline('plusieurs versions', (s, variables) => { s.Given("J'utilise Vue ", () => { - expect(['2', '3']).toContain(variables.version) + expect([ + '2', + '3', + ]).toContain(variables.version) }) s.And(`J'utilise {string}`, (ctx, tool: string) => { expect(tool).toEqual('nanostores') diff --git a/src/vitest/__tests__/mapped-variables.spec.ts b/src/vitest/__tests__/mapped-variables.spec.ts index 801df74..b6be5c2 100644 --- a/src/vitest/__tests__/mapped-variables.spec.ts +++ b/src/vitest/__tests__/mapped-variables.spec.ts @@ -33,10 +33,16 @@ describe('Mapped examples', () => { describeFeature(feature, (f) => { f.ScenarioOutline(`Mapped examples`, (s, variables) => { s.Given(`I am developper`, () => { - expect(['front', 'back']).toContain(variables.type) + expect([ + 'front', + 'back', + ]).toContain(variables.type) }) s.Then(`Figma is `, () => { - expect([true, false]).toContain(variables.state) + expect([ + true, + false, + ]).toContain(variables.state) }) s.But('Git is ', () => { expect(variables['other-state']).toEqual('required') @@ -63,18 +69,25 @@ describe('Mapped examples', () => { f.Rule('Mapped examples', (r) => { r.RuleScenarioOutline(`Mapped examples`, (s, variables) => { s.Given(`I am developper`, () => { - expect(['front', 'back']).toContain(variables.type) + expect([ + 'front', + 'back', + ]).toContain(variables.type) }) s.Then(`Figma is `, () => { - expect([true, false]).toContain(variables.state) + expect([ + true, + false, + ]).toContain(variables.state) }) s.But('Git is ', () => { expect(variables['other-state']).toEqual('required') }) s.And('I can use ', () => { - expect(['mercurial', 'svn']).toContain( - variables.another, - ) + expect([ + 'mercurial', + 'svn', + ]).toContain(variables.another) }) }) }) diff --git a/src/vitest/__tests__/only-skip/rule/skip-scenario-outline.spec.ts b/src/vitest/__tests__/only-skip/rule/skip-scenario-outline.spec.ts index db1de28..3a0c2e8 100644 --- a/src/vitest/__tests__/only-skip/rule/skip-scenario-outline.spec.ts +++ b/src/vitest/__tests__/only-skip/rule/skip-scenario-outline.spec.ts @@ -62,7 +62,10 @@ describe('RuleScenarioOutline.only', () => { 'called scenario outline', (s, variables) => { s.Given('My favorite game is ', () => { - expect(['GTA', 'AC Unity']).toContain(variables.game) + expect([ + 'GTA', + 'AC Unity', + ]).toContain(variables.game) fn() }) }, diff --git a/src/vitest/__tests__/only-skip/skip-scenario-outline.spec.ts b/src/vitest/__tests__/only-skip/skip-scenario-outline.spec.ts index 0acf105..46636f0 100644 --- a/src/vitest/__tests__/only-skip/skip-scenario-outline.spec.ts +++ b/src/vitest/__tests__/only-skip/skip-scenario-outline.spec.ts @@ -54,7 +54,10 @@ describe('Scenario.only', () => { }) f.ScenarioOutline.only('called scenario outline', (s, variables) => { s.Given('My favorite game is ', () => { - expect(['GTA', 'AC Unity']).toContain(variables.game) + expect([ + 'GTA', + 'AC Unity', + ]).toContain(variables.game) fn() }) }) diff --git a/src/vitest/__tests__/steps/define-step-orders.spec.ts b/src/vitest/__tests__/steps/define-step-orders.spec.ts index 422a2e7..4115adf 100644 --- a/src/vitest/__tests__/steps/define-step-orders.spec.ts +++ b/src/vitest/__tests__/steps/define-step-orders.spec.ts @@ -133,7 +133,10 @@ describe('defineSteps order with background', () => { }) f.ScenarioOutline('outline', (s, variables) => { s.Then('I use variable ', () => { - expect(['test', 'boom']).toContain(variables.name) + expect([ + 'test', + 'boom', + ]).toContain(variables.name) }) }) }) diff --git a/src/vitest/__tests__/steps/define-steps.spec.ts b/src/vitest/__tests__/steps/define-steps.spec.ts index ddab6fc..6311bc1 100644 --- a/src/vitest/__tests__/steps/define-steps.spec.ts +++ b/src/vitest/__tests__/steps/define-steps.spec.ts @@ -82,7 +82,10 @@ describe('Rule.defineSteps', () => { f.ScenarioOutline('first scenario outline', (s, variables) => { s.Then('I am called ', () => { - expect([1, 2]).toContain(Number.parseInt(variables.count)) + expect([ + 1, + 2, + ]).toContain(Number.parseInt(variables.count)) }) }) diff --git a/src/vitest/__tests__/steps/on-step-error.spec.ts b/src/vitest/__tests__/steps/on-step-error.spec.ts index 6380901..164ac84 100644 --- a/src/vitest/__tests__/steps/on-step-error.spec.ts +++ b/src/vitest/__tests__/steps/on-step-error.spec.ts @@ -31,7 +31,9 @@ describe('Use onStepError', () => { ]).parseContent() const onStepError = vi.fn() - setVitestCucumberConfiguration({ onStepError }) + setVitestCucumberConfiguration({ + onStepError, + }) describeFeature(feature, (f) => { f.Scenario('Simple scenario', (s) => { @@ -42,7 +44,11 @@ describe('Use onStepError', () => { onTestFailedCallback({ task: { result: { - errors: [{ message: 'epic fail !' }], + errors: [ + { + message: 'epic fail !', + }, + ], }, }, }) @@ -74,7 +80,9 @@ describe('Use onStepError', () => { ]).parseContent() const onStepError = vi.fn() - setVitestCucumberConfiguration({ onStepError }) + setVitestCucumberConfiguration({ + onStepError, + }) describeFeature(feature, (f) => { f.Background((s) => { @@ -87,7 +95,11 @@ describe('Use onStepError', () => { onTestFailedCallback({ task: { result: { - errors: [{ message: 'test' }], + errors: [ + { + message: 'test', + }, + ], }, }, }) @@ -122,7 +134,9 @@ describe('Use onStepError', () => { ]).parseContent() const onStepError = vi.fn() - setVitestCucumberConfiguration({ onStepError }) + setVitestCucumberConfiguration({ + onStepError, + }) describeFeature(feature, (f) => { f.ScenarioOutline('Simple scenario outline', (s) => { @@ -133,7 +147,11 @@ describe('Use onStepError', () => { onTestFailedCallback({ task: { result: { - errors: [{ message: 'miss !' }], + errors: [ + { + message: 'miss !', + }, + ], }, }, }) diff --git a/src/vitest/__tests__/tags/exclude-tags.spec.ts b/src/vitest/__tests__/tags/exclude-tags.spec.ts index 0f711bf..18f06af 100644 --- a/src/vitest/__tests__/tags/exclude-tags.spec.ts +++ b/src/vitest/__tests__/tags/exclude-tags.spec.ts @@ -26,9 +26,9 @@ describe(`Execute all scenarii if no exclusion tag`, async () => { feature.getScenarioByName(`Beta scenario`)?.isCalled, ).toBe(true) expect( - feature - .getScenarioByName(`Beta scenario`) - ?.matchTags([`beta`]), + feature.getScenarioByName(`Beta scenario`)?.matchTags([ + `beta`, + ]), ).toBe(true) }) Scenario(`Simple scenario`, ({ Given, Then }) => { @@ -40,7 +40,9 @@ describe(`Execute all scenarii if no exclusion tag`, async () => { Then(`It check I am executed`, () => {}) }) }, - { excludeTags: [] }, + { + excludeTags: [], + }, ) }) @@ -64,9 +66,9 @@ describe(`Ignore scenario with a tag`, async () => { feature.getScenarioByName(`Ignored scenario`)?.isCalled, ).toBe(false) expect( - feature - .getScenarioByName(`Ignored scenario`) - ?.matchTags([`beta`]), + feature.getScenarioByName(`Ignored scenario`)?.matchTags([ + `beta`, + ]), ).toBe(true) }) Scenario(`Simple scenario`, ({ Given, Then }) => { @@ -74,7 +76,11 @@ describe(`Ignore scenario with a tag`, async () => { Then(`It check I am executed`, () => {}) }) }, - { excludeTags: [`beta`] }, + { + excludeTags: [ + `beta`, + ], + }, ) }) @@ -98,9 +104,9 @@ describe(`Ignore scenario with a tag (alternative with an @ prefix)`, async () = feature.getScenarioByName(`Ignored scenario`)?.isCalled, ).toBe(false) expect( - feature - .getScenarioByName(`Ignored scenario`) - ?.matchTags([`beta`]), + feature.getScenarioByName(`Ignored scenario`)?.matchTags([ + `beta`, + ]), ).toBe(true) }) Scenario(`Simple scenario`, ({ Given, Then }) => { @@ -108,7 +114,11 @@ describe(`Ignore scenario with a tag (alternative with an @ prefix)`, async () = Then(`It check I am executed`, () => {}) }) }, - { excludeTags: [`@beta`] }, + { + excludeTags: [ + `@beta`, + ], + }, ) }) @@ -134,9 +144,9 @@ describe(`Ignore rule with a tag`, async () => { false, ) expect( - feature - .getRuleByName(`ignored rule`) - ?.matchTags([`normal`]), + feature.getRuleByName(`ignored rule`)?.matchTags([ + `normal`, + ]), ).toBe(true) }) Scenario(`Simple scenario`, ({ Given, Then }) => { @@ -146,7 +156,11 @@ describe(`Ignore rule with a tag`, async () => { Then(`check if I am called`, () => {}) }) }, - { excludeTags: [`normal`] }, + { + excludeTags: [ + `normal`, + ], + }, ) }) @@ -181,7 +195,9 @@ describe(`Ignore scenario in rule with a tag`, async () => { feature .getRuleByName(`rule with ignored scenario`) ?.getScenarioByName(`Simple scenario`) - ?.matchTags([`ignored`]), + ?.matchTags([ + `ignored`, + ]), ).toBe(true) }) Scenario(`Me I am executed`, ({ Given, Then }) => { @@ -197,7 +213,11 @@ describe(`Ignore scenario in rule with a tag`, async () => { }) }) }, - { excludeTags: [`ignored`] }, + { + excludeTags: [ + `ignored`, + ], + }, ) }) @@ -219,13 +239,17 @@ describe(`excludeTags`, () => { expect(featureCheck).toHaveBeenCalledWith( expect.objectContaining({ includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], }), ) expect(ruleCheck).toHaveBeenCalledWith( expect.objectContaining({ includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], }), ) }) @@ -335,7 +359,10 @@ describe(`excludeTags`, () => { }) }, { - excludeTags: [`ignored-scenario`, `ignored-rule`], + excludeTags: [ + `ignored-scenario`, + `ignored-rule`, + ], }, ) }) diff --git a/src/vitest/__tests__/tags/handle-tags.spec.ts b/src/vitest/__tests__/tags/handle-tags.spec.ts index 60d9dbe..1f1d7c1 100644 --- a/src/vitest/__tests__/tags/handle-tags.spec.ts +++ b/src/vitest/__tests__/tags/handle-tags.spec.ts @@ -25,9 +25,9 @@ describe(`Run scenario selected with a tag`, async () => { feature.getScenarioByName(`Selected scenario`)?.isCalled, ).toBe(true) expect( - feature - .getScenarioByName(`Selected scenario`) - ?.matchTags([`beta`]), + feature.getScenarioByName(`Selected scenario`)?.matchTags([ + `beta`, + ]), ).toBe(true) }) Scenario(`Selected scenario`, ({ Given, Then }) => { @@ -35,7 +35,11 @@ describe(`Run scenario selected with a tag`, async () => { Then(`It check I am executed`, () => {}) }) }, - { includeTags: [`beta`] }, + { + includeTags: [ + `beta`, + ], + }, ) }) @@ -62,9 +66,9 @@ describe(`Run scenario selected with a tag (alternative with an @ prefix)`, asyn feature.getScenarioByName(`Selected scenario`)?.isCalled, ).toBe(true) expect( - feature - .getScenarioByName(`Selected scenario`) - ?.matchTags([`beta`]), + feature.getScenarioByName(`Selected scenario`)?.matchTags([ + `beta`, + ]), ).toBe(true) }) Scenario(`Selected scenario`, ({ Given, Then }) => { @@ -72,7 +76,11 @@ describe(`Run scenario selected with a tag (alternative with an @ prefix)`, asyn Then(`It check I am executed`, () => {}) }) }, - { includeTags: [`@beta`] }, + { + includeTags: [ + `@beta`, + ], + }, ) }) @@ -98,9 +106,9 @@ describe(`Run rule with a tag`, async () => { false, ) expect( - feature - .getRuleByName(`ignored rule`) - ?.matchTags([`normal`]), + feature.getRuleByName(`ignored rule`)?.matchTags([ + `normal`, + ]), ).toBe(true) }) Scenario(`Simple scenario`, ({ Given, Then }) => { @@ -110,7 +118,11 @@ describe(`Run rule with a tag`, async () => { Then(`check if I am called`, () => {}) }) }, - { includeTags: [`awesome`] }, + { + includeTags: [ + `awesome`, + ], + }, ) }) @@ -145,7 +157,9 @@ describe(`Run scenario in rule with a tag`, async () => { feature .getRuleByName(`rule with ignored scenario`) ?.getScenarioByName(`Simple scenario`) - ?.matchTags([`ignored`]), + ?.matchTags([ + `ignored`, + ]), ).toBe(true) }) Scenario(`Me I am executed`, ({ Given, Then }) => { @@ -161,7 +175,11 @@ describe(`Run scenario in rule with a tag`, async () => { }) }) }, - { includeTags: [`inside`] }, + { + includeTags: [ + `inside`, + ], + }, ) }) @@ -183,13 +201,17 @@ describe(`includeTags`, () => { expect(featureCheck).toHaveBeenCalledWith( expect.objectContaining({ includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], }), ) expect(ruleCheck).toHaveBeenCalledWith( expect.objectContaining({ includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], }), ) }) @@ -258,7 +280,9 @@ describe(`includeTags`, () => { for (const fn of checks) { expect(fn).toHaveBeenCalledWith( expect.objectContaining({ - includeTags: [`simple`], + includeTags: [ + `simple`, + ], excludeTags: [], }), ) @@ -296,7 +320,9 @@ describe(`includeTags`, () => { }) }, { - includeTags: [`simple`], + includeTags: [ + `simple`, + ], excludeTags: [], }, ) @@ -340,7 +366,9 @@ describe('handle skipped Scenario', () => { }) }, { - excludeTags: ['skip'], + excludeTags: [ + 'skip', + ], }, ) }) @@ -370,7 +398,9 @@ describe('handle skipped Background', () => { }) }, { - excludeTags: ['skip'], + excludeTags: [ + 'skip', + ], }, ) }) @@ -403,7 +433,9 @@ describe('handle skipped Rule', () => { }) }, { - excludeTags: ['skip'], + excludeTags: [ + 'skip', + ], }, ) }) @@ -433,7 +465,9 @@ describe('handle skipped Background', () => { }) }, { - excludeTags: ['skip'], + excludeTags: [ + 'skip', + ], }, ) }) @@ -471,8 +505,12 @@ describe('handle include/exclude tags for skipped Scenario', () => { }) }, { - excludeTags: ['skip'], - includeTags: ['awesome'], + excludeTags: [ + 'skip', + ], + includeTags: [ + 'awesome', + ], }, ) }) diff --git a/src/vitest/configuration.ts b/src/vitest/configuration.ts index 0c1fdaf..05f0906 100644 --- a/src/vitest/configuration.ts +++ b/src/vitest/configuration.ts @@ -16,7 +16,9 @@ export type VitestCucumberOptions = { includeTags?: TagFilterItem[] excludeTags?: TagFilterItem[] predefinedSteps: ScenarioSteps[] - mappedExamples: { [key: string]: unknown } + mappedExamples: { + [key: string]: unknown + } onStepError?: (args: { error: Error; ctx: TaskContext; step: Step }) => void } @@ -26,7 +28,9 @@ function getDefaultConfiguration(): VitestCucumberOptions { return { language: 'en', includeTags: [], - excludeTags: ['ignore'], + excludeTags: [ + 'ignore', + ], onStepError: ({ error }) => {}, predefinedSteps: [], mappedExamples: {}, diff --git a/src/vitest/describe-feature.ts b/src/vitest/describe-feature.ts index 5d9c6a3..2843341 100644 --- a/src/vitest/describe-feature.ts +++ b/src/vitest/describe-feature.ts @@ -596,7 +596,10 @@ export function describeFeature( describe.only.each( onlyDescribeToRun.map((s) => { - return [s.describeTitle, s] + return [ + s.describeTitle, + s, + ] }), )(`%s`, (_, { describeHandler }) => { describeHandler() @@ -604,7 +607,10 @@ export function describeFeature( describe.skip.each( describeToSkip.map((s) => { - return [s.describeTitle, s] + return [ + s.describeTitle, + s, + ] }), )(`%s`, (_, { describeHandler }) => { describeHandler() @@ -612,7 +618,10 @@ export function describeFeature( describe.each( describeToRun.map((s) => { - return [s.describeTitle, s] + return [ + s.describeTitle, + s, + ] }), )(`%s`, (_, { describeHandler }) => { describeHandler() @@ -713,7 +722,10 @@ export function describeFeature( describe.only.each( onlyDescribeToRun.map((s) => { - return [s.describeTitle, s] + return [ + s.describeTitle, + s, + ] }), )(`%s`, (_, { describeHandler }) => { describeHandler() @@ -721,7 +733,10 @@ export function describeFeature( describe.skip.each( describeToSkip.map((s) => { - return [s.describeTitle, s] + return [ + s.describeTitle, + s, + ] }), )(`%s`, (_, { describeHandler }) => { describeHandler() @@ -730,7 +745,10 @@ export function describeFeature( // )(`%s`, async ([, scenarioStep], ctx) => { describe.each( describeToRun.map((s) => { - return [s.describeTitle, s] + return [ + s.describeTitle, + s, + ] }), )(`%s`, (_, parent) => { parent.describeHandler() diff --git a/src/vitest/describe/__tests__/scenario.spec.ts b/src/vitest/describe/__tests__/scenario.spec.ts index ba79ad4..34ecbbc 100644 --- a/src/vitest/describe/__tests__/scenario.spec.ts +++ b/src/vitest/describe/__tests__/scenario.spec.ts @@ -37,7 +37,14 @@ describe(`describeScenarioOutline`, () => { const each = vi.spyOn(test, `for`) const scenario = new ScenarioOutline(`test`) - scenario.examples.push({ test: `test` }, { test: `test 2` }) + scenario.examples.push( + { + test: `test`, + }, + { + test: `test 2`, + }, + ) scenario.addStep(new Step(StepTypes.GIVEN, `given `)) const scenarioTest = createScenarioOutlineDescribeHandler({ diff --git a/src/vitest/describe/describe-background.ts b/src/vitest/describe/describe-background.ts index 2e19799..402f32a 100644 --- a/src/vitest/describe/describe-background.ts +++ b/src/vitest/describe/describe-background.ts @@ -85,7 +85,10 @@ export function createBackgroundDescribeHandler({ return function backgroundDescribe() { test.for( backgroundStepsToRun.map((s): StepMap => { - return [s.key, s] + return [ + s.key, + s, + ] }), )(`%s`, async ([, scenarioStep], ctx) => { onTestFailed(({ task }) => { diff --git a/src/vitest/describe/describe-scenario-outline.ts b/src/vitest/describe/describe-scenario-outline.ts index 84dcd53..82869e2 100644 --- a/src/vitest/describe/describe-scenario-outline.ts +++ b/src/vitest/describe/describe-scenario-outline.ts @@ -17,7 +17,9 @@ type DescribeScenarioArgs = { scenarioTestCallback: (op: StepTest, variables: Example[0]) => MaybePromise beforeEachScenarioHook: () => MaybePromise afterEachScenarioHook: () => MaybePromise - mappedExamples: { [key: string]: unknown } + mappedExamples: { + [key: string]: unknown + } } export function createScenarioOutlineDescribeHandler({ @@ -95,7 +97,10 @@ export function createScenarioOutlineDescribeHandler({ return example?.map((exampleVariables) => { const mappedExampleVariables = Object.fromEntries( Object.entries(exampleVariables).map(([index, value]) => { - return [index, mappedExamples[value] ?? value] + return [ + index, + mappedExamples[value] ?? value, + ] }), ) @@ -147,7 +152,9 @@ export function createScenarioOutlineDescribeHandler({ await scenarioStep.fn(ctx, ...scenarioStep.params) }) - })([...scenarioStepsToRun]) + })([ + ...scenarioStepsToRun, + ]) }) } diff --git a/src/vitest/describe/describe-scenario.ts b/src/vitest/describe/describe-scenario.ts index 08e4516..f8bf339 100644 --- a/src/vitest/describe/describe-scenario.ts +++ b/src/vitest/describe/describe-scenario.ts @@ -100,7 +100,10 @@ export function createScenarioDescribeHandler({ test.for( scenarioStepsToRun.map((s): StepMap => { - return [s.key, s] + return [ + s.key, + s, + ] }), )(`%s`, async ([, scenarioStep], ctx) => { onTestFailed(({ task }) => { diff --git a/src/vitest/describe/types.ts b/src/vitest/describe/types.ts index a00bba0..f792b8a 100644 --- a/src/vitest/describe/types.ts +++ b/src/vitest/describe/types.ts @@ -11,4 +11,7 @@ export type ScenarioSteps = { params: unknown[] } -export type StepMap = [string, ScenarioSteps] +export type StepMap = [ + string, + ScenarioSteps, +] diff --git a/vitest.config.ts b/vitest.config.ts index de0cf39..84c49d8 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -14,7 +14,9 @@ export default defineConfig({ // }), ], test: { - setupFiles: ['vitest.setup.ts'], + setupFiles: [ + 'vitest.setup.ts', + ], passWithNoTests: true, globals: true, coverage: { From f99671ce1021ea3ddfbcadec7e0464f907cfb213 Mon Sep 17 00:00:00 2001 From: amiceli Date: Sun, 20 Jul 2025 16:10:42 +0200 Subject: [PATCH 4/5] chore: use expand options with biome --- biome.json | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/biome.json b/biome.json index b78bc63..41d2088 100644 --- a/biome.json +++ b/biome.json @@ -1,18 +1,23 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "organizeImports": { - "enabled": true + "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json", + "assist": { + "actions": { + "source": { + "organizeImports": "on" + } + } }, "files": { - "ignore": [ - "package.json", - "package-lock.json", - "dist/", - "coverage/", - "tsconfig.json", - "tsconfig.vitest.json", - "src/parser/lang/lang.json", - "reports" + "includes": [ + "**", + "!**/package.json", + "!**/package-lock.json", + "!**/dist/**", + "!**/coverage/**", + "!**/tsconfig.json", + "!**/tsconfig.vitest.json", + "!**/src/parser/lang/lang.json", + "!**/reports/**" ] }, "linter": { @@ -30,7 +35,8 @@ }, "formatter": { "indentStyle": "space", - "indentWidth": 4 + "indentWidth": 4, + "expand": "always" }, "javascript": { "formatter": { From 392b02dcd0fa9517c0835a9d4545c98d701e0fb5 Mon Sep 17 00:00:00 2001 From: amiceli Date: Sun, 20 Jul 2025 16:10:55 +0200 Subject: [PATCH 5/5] chore: update biome and lefthook versions --- package-lock.json | 160 +++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/package-lock.json b/package-lock.json index 30a9fed..063de72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,13 +19,13 @@ "vitest-cucumber": "dist/cli-generate.js" }, "devDependencies": { - "@biomejs/biome": "2.1.1", + "@biomejs/biome": "2.1.2", "@commitlint/cli": "^19.8.1", "@commitlint/config-conventional": "^19.8.1", "@types/node": "^20.4.5", "@vitest/coverage-v8": "^3.1.4", "esbuild": "0.25.5", - "lefthook": "^1.11.14", + "lefthook": "^1.12.2", "typescript": "^5.8.3" } }, @@ -114,9 +114,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.1.1.tgz", - "integrity": "sha512-HFGYkxG714KzG+8tvtXCJ1t1qXQMzgWzfvQaUjxN6UeKv+KvMEuliInnbZLJm6DXFXwqVi6446EGI0sGBLIYng==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.1.2.tgz", + "integrity": "sha512-yq8ZZuKuBVDgAS76LWCfFKHSYIAgqkxVB3mGVVpOe2vSkUTs7xG46zXZeNPRNVjiJuw0SZ3+J2rXiYx0RUpfGg==", "dev": true, "license": "MIT OR Apache-2.0", "bin": { @@ -130,20 +130,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "2.1.1", - "@biomejs/cli-darwin-x64": "2.1.1", - "@biomejs/cli-linux-arm64": "2.1.1", - "@biomejs/cli-linux-arm64-musl": "2.1.1", - "@biomejs/cli-linux-x64": "2.1.1", - "@biomejs/cli-linux-x64-musl": "2.1.1", - "@biomejs/cli-win32-arm64": "2.1.1", - "@biomejs/cli-win32-x64": "2.1.1" + "@biomejs/cli-darwin-arm64": "2.1.2", + "@biomejs/cli-darwin-x64": "2.1.2", + "@biomejs/cli-linux-arm64": "2.1.2", + "@biomejs/cli-linux-arm64-musl": "2.1.2", + "@biomejs/cli-linux-x64": "2.1.2", + "@biomejs/cli-linux-x64-musl": "2.1.2", + "@biomejs/cli-win32-arm64": "2.1.2", + "@biomejs/cli-win32-x64": "2.1.2" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.1.1.tgz", - "integrity": "sha512-2Muinu5ok4tWxq4nu5l19el48cwCY/vzvI7Vjbkf3CYIQkjxZLyj0Ad37Jv2OtlXYaLvv+Sfu1hFeXt/JwRRXQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.1.2.tgz", + "integrity": "sha512-leFAks64PEIjc7MY/cLjE8u5OcfBKkcDB0szxsWUB4aDfemBep1WVKt0qrEyqZBOW8LPHzrFMyDl3FhuuA0E7g==", "cpu": [ "arm64" ], @@ -158,9 +158,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.1.1.tgz", - "integrity": "sha512-cC8HM5lrgKQXLAK+6Iz2FrYW5A62pAAX6KAnRlEyLb+Q3+Kr6ur/sSuoIacqlp1yvmjHJqjYfZjPvHWnqxoEIA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.1.2.tgz", + "integrity": "sha512-Nmmv7wRX5Nj7lGmz0FjnWdflJg4zii8Ivruas6PBKzw5SJX/q+Zh2RfnO+bBnuKLXpj8kiI2x2X12otpH6a32A==", "cpu": [ "x64" ], @@ -175,9 +175,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.1.1.tgz", - "integrity": "sha512-tw4BEbhAUkWPe4WBr6IX04DJo+2jz5qpPzpW/SWvqMjb9QuHY8+J0M23V8EPY/zWU4IG8Ui0XESapR1CB49Q7g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.1.2.tgz", + "integrity": "sha512-NWNy2Diocav61HZiv2enTQykbPP/KrA/baS7JsLSojC7Xxh2nl9IczuvE5UID7+ksRy2e7yH7klm/WkA72G1dw==", "cpu": [ "arm64" ], @@ -192,9 +192,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.1.1.tgz", - "integrity": "sha512-/7FBLnTswu4jgV9ttI3AMIdDGqVEPIZd8I5u2D4tfCoj8rl9dnjrEQbAIDlWhUXdyWlFSz8JypH3swU9h9P+2A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.1.2.tgz", + "integrity": "sha512-qgHvafhjH7Oca114FdOScmIKf1DlXT1LqbOrrbR30kQDLFPEOpBG0uzx6MhmsrmhGiCFCr2obDamu+czk+X0HQ==", "cpu": [ "arm64" ], @@ -209,9 +209,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.1.1.tgz", - "integrity": "sha512-3WJ1GKjU7NzZb6RTbwLB59v9cTIlzjbiFLDB0z4376TkDqoNYilJaC37IomCr/aXwuU8QKkrYoHrgpSq5ffJ4Q==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.1.2.tgz", + "integrity": "sha512-Km/UYeVowygTjpX6sGBzlizjakLoMQkxWbruVZSNE6osuSI63i4uCeIL+6q2AJlD3dxoiBJX70dn1enjQnQqwA==", "cpu": [ "x64" ], @@ -226,9 +226,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.1.1.tgz", - "integrity": "sha512-kUu+loNI3OCD2c12cUt7M5yaaSjDnGIksZwKnueubX6c/HWUyi/0mPbTBHR49Me3F0KKjWiKM+ZOjsmC+lUt9g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.1.2.tgz", + "integrity": "sha512-xlB3mU14ZUa3wzLtXfmk2IMOGL+S0aHFhSix/nssWS/2XlD27q+S6f0dlQ8WOCbYoXcuz8BCM7rCn2lxdTrlQA==", "cpu": [ "x64" ], @@ -243,9 +243,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.1.1.tgz", - "integrity": "sha512-vEHK0v0oW+E6RUWLoxb2isI3rZo57OX9ZNyyGH701fZPj6Il0Rn1f5DMNyCmyflMwTnIQstEbs7n2BxYSqQx4Q==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.1.2.tgz", + "integrity": "sha512-G8KWZli5ASOXA3yUQgx+M4pZRv3ND16h77UsdunUL17uYpcL/UC7RkWTdkfvMQvogVsAuz5JUcBDjgZHXxlKoA==", "cpu": [ "arm64" ], @@ -260,9 +260,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.1.1.tgz", - "integrity": "sha512-i2PKdn70kY++KEF/zkQFvQfX1e8SkA8hq4BgC+yE9dZqyLzB/XStY2MvwI3qswlRgnGpgncgqe0QYKVS1blksg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.1.2.tgz", + "integrity": "sha512-9zajnk59PMpjBkty3bK2IrjUsUHvqe9HWwyAWQBjGLE7MIBjbX2vwv1XPEhmO2RRuGoTkVx3WCanHrjAytICLA==", "cpu": [ "x64" ], @@ -2428,9 +2428,9 @@ } }, "node_modules/lefthook": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook/-/lefthook-1.11.14.tgz", - "integrity": "sha512-Dv91Lnu/0jLT5pCZE0IkEfrpTXUhyX9WG4upEMPkKPCl5aBgJdoqVw/hbh8drcVrC6y7k1PqsRmWSERmO57weQ==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook/-/lefthook-1.12.2.tgz", + "integrity": "sha512-2CeTu5NcmoT9YnqsHTq/TF36MlqlzHzhivGx3DrXHwcff4TdvrkIwUTA56huM3Nlo5ODAF/0hlPzaKLmNHCBnQ==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2438,22 +2438,22 @@ "lefthook": "bin/index.js" }, "optionalDependencies": { - "lefthook-darwin-arm64": "1.11.14", - "lefthook-darwin-x64": "1.11.14", - "lefthook-freebsd-arm64": "1.11.14", - "lefthook-freebsd-x64": "1.11.14", - "lefthook-linux-arm64": "1.11.14", - "lefthook-linux-x64": "1.11.14", - "lefthook-openbsd-arm64": "1.11.14", - "lefthook-openbsd-x64": "1.11.14", - "lefthook-windows-arm64": "1.11.14", - "lefthook-windows-x64": "1.11.14" + "lefthook-darwin-arm64": "1.12.2", + "lefthook-darwin-x64": "1.12.2", + "lefthook-freebsd-arm64": "1.12.2", + "lefthook-freebsd-x64": "1.12.2", + "lefthook-linux-arm64": "1.12.2", + "lefthook-linux-x64": "1.12.2", + "lefthook-openbsd-arm64": "1.12.2", + "lefthook-openbsd-x64": "1.12.2", + "lefthook-windows-arm64": "1.12.2", + "lefthook-windows-x64": "1.12.2" } }, "node_modules/lefthook-darwin-arm64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.11.14.tgz", - "integrity": "sha512-YPbUK6kGytY5W6aNUrzK7Vod3ynLVvj5JQiBh0DjlxCHMgIQPpFkDfwQzGw1E8CySyC95HXO83En5Ule8umS7g==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.12.2.tgz", + "integrity": "sha512-fTxeI9tEskrHjc3QyEO+AG7impBXY2Ed8V5aiRc3fw9POfYtVh9b5jRx90fjk2+ld5hf+Z1DsyyLq/vOHDFskQ==", "cpu": [ "arm64" ], @@ -2465,9 +2465,9 @@ ] }, "node_modules/lefthook-darwin-x64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-darwin-x64/-/lefthook-darwin-x64-1.11.14.tgz", - "integrity": "sha512-l9RhSBp1SHqLCjSGWoeeVWqKcTBOMW8v2CCYrUt5eb6sik7AjT6+Neqf3sClsXH7SjELjj43yjmg6loqPtfDgg==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-darwin-x64/-/lefthook-darwin-x64-1.12.2.tgz", + "integrity": "sha512-T1dCDKAAfdHgYZ8qtrS02SJSHoR52RFcrGArFNll9Mu4ZSV19Sp8BO+kTwDUOcLYdcPGNaqOp9PkRBQGZWQC7g==", "cpu": [ "x64" ], @@ -2479,9 +2479,9 @@ ] }, "node_modules/lefthook-freebsd-arm64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.11.14.tgz", - "integrity": "sha512-oSdJKGGMohktFXC6faZCUt5afyHpDwWGIWAkHGgOXUVD/LiZDEn6U/8cQmKm1UAfBySuPTtfir0VeM04y6188g==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.12.2.tgz", + "integrity": "sha512-2n9z7Q4BKeMBoB9cuEdv0UBQH82Z4GgBQpCrfjCtyzpDnYQwrH8Tkrlnlko4qPh9MM6nLLGIYMKsA5nltzo8Cg==", "cpu": [ "arm64" ], @@ -2493,9 +2493,9 @@ ] }, "node_modules/lefthook-freebsd-x64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.11.14.tgz", - "integrity": "sha512-gZdMWZwOtIhIPK3GPYac7JhXrxF188gkw65i6O7CedS/meDlK2vjBv5BUVLeD/satv4+jibEdV0h4Qqu/xIh2A==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.12.2.tgz", + "integrity": "sha512-1hNY/irY+/3kjRzKoJYxG+m3BYI8QxopJUK1PQnknGo1Wy5u302SdX+tR7pnpz6JM5chrNw4ozSbKKOvdZ5VEw==", "cpu": [ "x64" ], @@ -2507,9 +2507,9 @@ ] }, "node_modules/lefthook-linux-arm64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-linux-arm64/-/lefthook-linux-arm64-1.11.14.tgz", - "integrity": "sha512-sZmqbTsGQFQw7gbfi9eIHFOxfcs66QfZYLRMh1DktODhyhRXB8RtI6KMeKCtPEGLhbK55/I4TprC8Qvj86UBgw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-linux-arm64/-/lefthook-linux-arm64-1.12.2.tgz", + "integrity": "sha512-1W4swYIVRkxq/LFTuuK4oVpd6NtTKY4E3VY2Uq2JDkIOJV46+8qGBF+C/QA9K3O9chLffgN7c+i+NhIuGiZ/Vw==", "cpu": [ "arm64" ], @@ -2521,9 +2521,9 @@ ] }, "node_modules/lefthook-linux-x64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-linux-x64/-/lefthook-linux-x64-1.11.14.tgz", - "integrity": "sha512-c+to1BRzFe419SNXAR6YpCBP8EVWxvUxlON3Z+efzmrHhdlhm7LvEoJcN4RQE4Gc2rJQJNe87OjsEZQkc4uQLg==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-linux-x64/-/lefthook-linux-x64-1.12.2.tgz", + "integrity": "sha512-J6VGuMfhq5iCsg1Pv7xULbuXC63gP5LaikT0PhkyBNMi3HQneZFDJ8k/sp0Ue9HkQv6QfWIo3/FgB9gz38MCFw==", "cpu": [ "x64" ], @@ -2535,9 +2535,9 @@ ] }, "node_modules/lefthook-openbsd-arm64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-openbsd-arm64/-/lefthook-openbsd-arm64-1.11.14.tgz", - "integrity": "sha512-fivG3D9G4ASRCTf3ecfz1WdnrHCW9pezaI8v1NVve8t6B2q0d0yeaje5dfhoAsAvwiFPRaMzka1Qaoyu8O8G9Q==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-openbsd-arm64/-/lefthook-openbsd-arm64-1.12.2.tgz", + "integrity": "sha512-wncDRW3ml24DaOyH22KINumjvCohswbQqbxyH2GORRCykSnE859cTjOrRIchTKBIARF7PSeGPUtS7EK0+oDbaw==", "cpu": [ "arm64" ], @@ -2549,9 +2549,9 @@ ] }, "node_modules/lefthook-openbsd-x64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-openbsd-x64/-/lefthook-openbsd-x64-1.11.14.tgz", - "integrity": "sha512-vikmG0jf7JVKR3be6Wk3l1jtEdedEqk1BTdsaHFX1bj0qk0azcqlZ819Wt/IoyIYDzQCHKowZ6DuXsRjT+RXWA==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-openbsd-x64/-/lefthook-openbsd-x64-1.12.2.tgz", + "integrity": "sha512-2jDOkCHNnc/oK/vR62hAf3vZb1EQ6Md2GjIlgZ/V7A3ztOsM8QZ5IxwYN3D1UOIR5ZnwMBy7PtmTJC/HJrig5w==", "cpu": [ "x64" ], @@ -2563,9 +2563,9 @@ ] }, "node_modules/lefthook-windows-arm64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-windows-arm64/-/lefthook-windows-arm64-1.11.14.tgz", - "integrity": "sha512-5PoAJ9QKaqxJn1NWrhrhXpAROpl/dT7bGTo7VMj2ATO1cpRatbn6p+ssvc3tgeriFThowFb1D11Fg6OlFLi6UQ==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-windows-arm64/-/lefthook-windows-arm64-1.12.2.tgz", + "integrity": "sha512-ZMH/q6UNSidhHEG/1QoqIl1n4yPTBWuVmKx5bONtKHicoz4QCQ+QEiNjKsG5OO4C62nfyHGThmweCzZVUQECJw==", "cpu": [ "arm64" ], @@ -2577,9 +2577,9 @@ ] }, "node_modules/lefthook-windows-x64": { - "version": "1.11.14", - "resolved": "https://registry.npmjs.org/lefthook-windows-x64/-/lefthook-windows-x64-1.11.14.tgz", - "integrity": "sha512-kBeOPR0Aj5hQGxoBBntgz5/e/xaH5Vnzlq9lJjHW8sf23qu/JVUGg6ceCoicyVWJi+ZOBliTa8KzwCu+mgyJjw==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/lefthook-windows-x64/-/lefthook-windows-x64-1.12.2.tgz", + "integrity": "sha512-TqT2jIPcTQ9uwaw+v+DTmvnUHM/p7bbsSrPoPX+fRXSGLzFjyiY+12C9dObSwfCQq6rT70xqQJ9AmftJQsa5/Q==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index a3d4b4b..1e49b04 100644 --- a/package.json +++ b/package.json @@ -35,13 +35,13 @@ "author": "amiceli", "license": "ISC", "devDependencies": { - "@biomejs/biome": "2.1.1", + "@biomejs/biome": "2.1.2", "@commitlint/cli": "^19.8.1", "@commitlint/config-conventional": "^19.8.1", "@types/node": "^20.4.5", "@vitest/coverage-v8": "^3.1.4", "esbuild": "0.25.5", - "lefthook": "^1.11.14", + "lefthook": "^1.12.2", "typescript": "^5.8.3" }, "dependencies": {