piotrwitek / ts-mocha

Mocha thin wrapper that allows running TypeScript tests with TypeScript runtime (ts-node) to get rid of compilation complexity
MIT License
190 stars 25 forks source link

Update dependencies #84

Open felipeplets opened 1 year ago

felipeplets commented 1 year ago

Update the project to run with the latest dev dependencies and remove all npm audit vulnerabilities.

larssn commented 1 year ago

Status on getting this merged?

There's an issue deploying to Cloud Functions if you have a dependency on ts-mocha currently, due to the ts-node: 7.0.1 dependency. This PR would fix that.

Appears to have been fixed by what I assume is the CF team.

Still, I think it would be a good idea to get these dependencies updated, so issues like that don't come back.

piotrwitek commented 1 year ago

Thanks for sharing the feedback @larssn, have you tested the build from this branch to make sure it's working as expected? I could merge it as soon as it's confirmed as I cannot test it myself. Thanks

larssn commented 1 year ago

Alright, so here's how I tested it:

npm list ts-node
├─┬ firebase-functions-test@3.0.0
│ └─┬ jest@29.5.0
│   └─┬ @jest/core@29.5.0
│     └─┬ jest-config@29.5.0
│       └── ts-node@10.9.1
└─┬ ts-mocha@10.0.0
  └── ts-node@7.0.1
// The ts-node 7.0.1 was causing problems here.

npm r ts-mocha
npm i -D https://github.com/felipeplets/ts-mocha.git#update/deps

npm list ts-node
├─┬ firebase-functions-test@3.0.0
│ └─┬ jest@29.5.0
│   └─┬ @jest/core@29.5.0
│     └─┬ jest-config@29.5.0
│       └── ts-node@10.9.1 deduped
└─┬ ts-mocha@10.0.0 (git+ssh://git@github.com/felipeplets/ts-mocha.git#943ec777692a555438c3e1bef632570d92bb8922)
  └── ts-node@10.9.1
// No more ts-node 7.0.1

ts-mocha -p tsconfig.test.json test/**/*.spec.ts --reporter spec
 484 passing (79ms)

firebase deploy <...>
✔  functions: Finished running postdeploy script.
✔  Deploy complete!

Seems to work

felipeplets commented 1 year ago

Thank you for testing @larssn.

@piotrwitek The only detail is that we would have to release a major version with this since we may break for users that don't have ts-node for any other purpose. I can write down the changelog with the details if you want, just let me know and we coordinate the launch.

stenneepro commented 8 months ago

When the PR will be merged? Can we upgrade TypeScript version to 5.x?

felipeplets commented 8 months ago

@stenneepro I can update it and test next week. But feel free to contribute earlier if you can.

Also, for curiosity are you setting any problem because of ts-mocha when trying to upgrade to TyeScript 5? As it is a dev dependency I don't expect it to prevent you from upgrading your application.

stenneepro commented 8 months ago

@felipeplets I don't think upgrade to TypeScript 5 blocks my application.

piotrwitek commented 7 months ago

Hey @felipeplets, let me know when it's ready for release I could make an npm RC release to make users testing easier.