Replies: 1 comment 1 reply
-
I would change const withTypeScriptVersions = (range, title, implementation) => {
for (const version of expandRange(range)) {
test(`typescript@version — ${title}`, t => implementation(t, {version})
}
} Which, probably, you already thought of. It became hard to correctly type the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there.
I've been meaning to migrate to ava 4 for a while now, and I've also made some attempts. However, I'm relying quite heavily on the feature from ava 3 where multiple macros can be passed to
test
, something that was removed in this PR.Specifically, I'm maintaining a bunch of libraries and tooling around TypeScript, and for all of these libraries, I'm running the entire test suite against all or most TypeScript versions. For example, a test might look like this:
There, every minor version of TypeScript from v3.8 and up will be passed to the implementation, and I can easily see in the test results which TS versions had problems.
Other tests may receive a different set of macros, corresponding to another set of TypeScript versions.
These tests are typically spread across many files and there are typically a ton of them.
I've read through your original PR in which you state:
However, for my use case, the amount of macros each implementation/test is called with is varying (as seen in the example above). I'm not always passing the same amount of TypeScript versions (macros) through to each test, so I can't just iterate through all of them, or at least I would have to add some guards in front of the respective tests. I do see some ways to implement it, of course, but none that is as clean as what's currently possible.
I'm hoping there's a way to achieve a similar setup with ava 4, and if so, I'd love to see either a migration guide or some hints as to how to achieve it. If you're interested in seeing how I solve it today, one example is the test suite of rollup-plugin-ts, and here is the macro implementation.
I would also ask that you may reconsider supporting multiple macros again, unless there is an obvious and clear migration path forward.
Thanks for your time!
Beta Was this translation helpful? Give feedback.
All reactions