chore: testing updates and tweaks - #107
Conversation
| // Tests the delaying mechanism | ||
|
|
||
| import { jest } from '@jest/globals' | ||
| import { jest, describe, beforeEach, afterEach, it } from '@jest/globals' |
There was a problem hiding this comment.
| import { jest, describe, beforeEach, afterEach, it } from '@jest/globals' | |
| import { jest, describe, beforeEach, afterEach, it, expect } from '@jest/globals' |
gamemaker1
left a comment
There was a problem hiding this comment.
Made one suggested change to fix the CI failure. Rest looks good.
Since Typescript 7 released, I have been thinking of moving things from jest to vitest (no/minimal code changes required since API is the same) to avoid all this plumbing we have to do for Typescript support. Similarly, we could move from esbuild + dts-bundle-generator to tsdown (reduces a lot of our config mess), since dts-bundle-generator doesn't yet support Typescript 7.
I'll make PRs for each and we'll see how it looks, if you think it is good, we can merge it for this package and the express-rate-limit package as well.
Fixes #105 The default maxDelayMs is now the largest 32-bit signed integer instead of infinity, and it will throw an error at instantiation time (instead of later on at runtime) if you try to set a value higher than that. Note: I've been testing a local/offline ai coding setup, and it did most of the changes here. I reviewed it myself already, but please give this one a little extra scrutiny in case there's anything that I missed.
Co-authored-by: Vedant Kulkarni <gamemaker0042@gmail.com>
This is a handful of related test improvements that I am just trying to get out of the way to work on something else: * Upgraded to the latest ts-jest dependency because my local tests started failing with jest reading untransformed typescript as if it were javascript, and upgrading ts-jest fixed it * Dropped @types/jest in favor of @jest/globals - https://jestjs.io/docs/getting-started#type-definitions recommends one or the other, not both * explicitly imported jest object and methods into each test file where they're used (the @jest/globals way) - this makes my editory happy * fixed a few tests that were passing a failure message to expect - jest doesn't support this, I'm not sure why it was passing lint before, maybe @types/jest is overly permissive? * split one compound expect(A && B) into two standalone expect(A); expect(B); calls * fixed a typo I noticed
|
Shoot, I thought I had things passing here before I opened the PR. Maybe it was the merge with master. I ended up fixing a formatting glitch in The other things you mentioned sound good, at least worth looking into. |
This is a handful of related test improvements that I am just trying to get out of the way to work on something else: