thiagodp / codeceptjs-dbhelper

📜 Let your CodeceptJS tests talk to databases
MIT License
9 stars 1 forks source link

Create TS definition #12

Closed mirao closed 3 years ago

mirao commented 3 years ago

Motivation: I started to migrate my JS tests to TS format and want to be able to have functional IntelliSense in VSCode and TS check in TS tests:

dbhelper

mirao commented 3 years ago

@thiagodp The conflicts seem to be caused by changes in https://github.com/thiagodp/codeceptjs-dbhelper/commit/f369296ec802dfd21b9849000a2c61134f07eb6a ?

mirao commented 3 years ago

If needed I can patch index.js and regenerate TS definition (index.d.ts) again, from latest master.

thiagodp commented 3 years ago

Hello @mirao! Yesterday, after accepting your contribution to codeceptjs-cmdhelper, I included an index.d.ts file to this project. I just fixed the optional parameters in JSDoc (to include a brackets), and maybe this PR is not needed anymore. Anyway, thank you for the contributions.

mirao commented 3 years ago

just fixed the optional parameters in JSDoc (to include a brackets), and maybe this PR is not needed anymore.

The latest version 1.2.1 works well, thanks for new release, it works as expected for me.

Only note that now index.ts has set driver instead of [driver] in JSDoc, so if you regenerate TS definition (npx -p typescript ...) in future, index.d.ts will get driver instead of driver? and therefore this TS check will fail:

2021-09-17_13-25 :

thiagodp commented 3 years ago

@mirao index.js' JSDoc is now fixed (v1.2.2) and index.d.ts is being generated from it using tsc. Thx again.