avajs / ava-codemods

Codemods for AVA
https://ava.li
MIT License
68 stars 16 forks source link

Improvements to Tape→AVA conversion #31

Closed sindresorhus closed 5 years ago

sindresorhus commented 8 years ago

Follow-up to https://github.com/avajs/ava-codemods/pull/28.

Commented by @skovhus:

My observations:

If you've tried it out and have some feedback. Comment below.

skovhus commented 8 years ago

I solved the if t.end is in the scope of the test function, we could remove it and not use cb style as part of #28 , but the other ones are still valid. 👍

dawsbot commented 7 years ago

Has the idea been proposed to do a non-".serial()" conversion as an optional flag? Although ava cannot guarantee the tape tests will suddenly work async, the user should be able to opt-in on a global scale for the conversion.

sindresorhus commented 7 years ago

@dawsonbotsford No, because we don't think it's a good idea. You should go through your tests afterwards and remove .serial() where you can manually confirm it's safe. What's your argument for adding this?

dawsbot commented 7 years ago

@sindresorhus If you've written atomic tests from the start using tape, removing .serial() will have no side-effects beyond making tests fast. This would not be assumed, and therefore hidden behind an opt-in flag.

sindresorhus commented 7 years ago

@dawsonbotsford I don't think many write atomic tests with tape, but happy to accept a good pull request for a opt-in flag if you think it would be useful.

dawsbot commented 7 years ago

@sindresorhus If you don't see that as useful I'm not married to the idea. Let me know if that changes and I'd be happy to help.