Skip to content

feat(ts): improve hook types (Background/Before/After/BeforeSuite/Aft… - #5743

Open
netoctone wants to merge 1 commit into
codeceptjs:4.xfrom
netoctone:feat/improve-global-hooks-types
Open

netoctone wants to merge 1 commit into
codeceptjs:4.xfrom
netoctone:feat/improve-global-hooks-types

Conversation

@netoctone

Copy link
Copy Markdown

Motivation/Description of the PR

Improve types of global hooks - Background, Before, After, BeforeSuite, AfterSuite.
Now hook callback's argument includes type for { suite } field.
And for Background, Before, After only - type for { test } field.
Also introducing aliases GherkinBefore and GherkinAfter for existing Before and After hooks, because types of gherkin Before/After are incompatible with types of mocha Before/After.

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium

Applicable plugins:

  • aiTrace
  • autoDelay
  • autoLogin
  • customLocator
  • pause
  • coverage
  • heal
  • retryFailedStep
  • screenshot
  • selenoid
  • stepTimeout
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

…erSuite)

also, introduce hook aliases global.GherkinBefore and global.GherkinAfter
because gherkin hooks types are incompatible with mocha global.Before and global.After

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant