-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library wrapping Ava #268
Comments
If they wrapped instance might provide other arguments, there are lots of rule assumptions that go out the window. |
I feel like instead of wrapping AVA, AVA should provide hooks that enable new functionality. Can you describe the problems you’re trying to solve by wrapping AVA? |
I tend to iterate tests over different inputs. I love Ava but I personally find the syntax for macros not very intuitive and would prefer a syntax closer to Jest's Besides this difference of syntax, there are additional features I would like:
I have created a library const test = require('ava')
const { each } = require('test-each')
// The code we are testing
const multiply = require('./multiply.js')
// Run this test 4 times using every possible combination of inputs
each([0.5, 10], [2.5, 5], ({ title }, first, second) => {
test(`should mix integers and floats | ${title}`, t => {
t.is(typeof multiply(first, second), 'number')
})
}) The library is designed to work with any test runner. However I want to create an adapter for Ava to make the syntax even simpler: const ava = require('ava')
const avaTestEach = require('ava-test-each')
const test = avaTestEach(ava)
test([0.5, 10], [2.5, 5], 'should mix integers and floats', (t, first, second) => {
t.is(typeof multiply(first, second), 'number')
}) My two concerns are:
|
Some libraries might be wrapping Ava, for example:
or:
Also the
test()
function (and its variants.skip(...)
, etc.) might be wrapped as well and provide slightly different arguments:I think this does not work with
eslint-plugin-ava
because this plugin might rely on (correct me if I'm wrong):test()
being called"ava"
test()
signature not being modifiedtest()
(that one should not be an issue though)I am considering developing a small wrapper around Ava but I am realizing using that wrapper might not be compatible with
eslint-plugin-ava
. Would it be possible to add support for such wrappers?I understand that might add lots of complexity, so feel free to close this issue if you don't think it's a good idea :)
The text was updated successfully, but these errors were encountered: