Skip to content

Conversation

@nlespiaucq
Copy link
Contributor

Motivation/Description of the PR

  • Provide TypeScript definitions for all helper methods with promise,
  • Add new configuration fullPromiseBased to refer the promise-based definition.
  • Fix runner-related tests and add typing tests

Applicable helpers:

  • WebDriver
  • Puppeteer
  • Nightmare
  • REST
  • FileHelper
  • Appium
  • Protractor
  • TestCafe
  • Playwright

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 📋 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)

Copy link
Contributor

@DavertMik DavertMik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nlespiaucq awesome! Just one question here:

runok.js Outdated
console.log('Generate TypeScript definition');
await npx('jsdoc -c typings/jsdoc.conf.js');
await npx('jsdoc -c typings/jsdocPromiseBased.conf.js');
fs.renameSync('types.d.ts', 'typings/promiseBasedTypes.d.ts');
Copy link
Contributor

@DavertMik DavertMik Oct 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should execute here:

await npx('jsdoc -c typings/jsdoc.conf.js');

so types.d.ts to be actually generated for classical setup?
because according to the code, you generate types twice, overwrites them on second run and move them, but the result of 'jsdoc -c typings/jsdoc.conf.js' is overwritten

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right - I will fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's confusing, but it was done on purpose.
In fact, the 2nd command generates the file types.d.ts on another location, on the root of the folder (to avoid to overwritten the first one). It's why I rename and move this file.

I will have some comments and make it more consistent.

@nlespiaucq nlespiaucq force-pushed the promise-based-helpers branch from 0e12914 to e08ab86 Compare October 27, 2022 19:38
@nlespiaucq nlespiaucq force-pushed the promise-based-helpers branch from e08ab86 to 1f9320a Compare October 27, 2022 19:41
Copy link
Contributor

@DavertMik DavertMik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was huge!
Thanks, @nlespiaucq for making it happen!

@DavertMik DavertMik merged commit 7f80cfa into codeceptjs:3.x Nov 25, 2022
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.

2 participants