Closed erezrokah closed 2 years ago
What would you think about being able to configure the comparator function in an ava.config.js
file?
What would you think about being able to configure the comparator function in an
ava.config.js
file?
That would be great and will solve our use case 💯
Are you open for me to contribute this change or prefer someone else to do it?
All yours @erezrokah! Let me know if you have questions.
Please provide details about:
What you're trying to do
Follow up to https://github.com/avajs/ava/issues/1811. Better load balance test files across multiple CI machines
Why you can't use AVA for this
Ava sorts files by file name, which is not the best load balancing strategy, especially when some tests are slower than others.
And maybe how you think AVA could handle this
Allow setting a custom comparator to be used here: https://github.com/avajs/ava/blob/3131ccd9f04a2cc521bc50b3533137e91f34b335/lib/api.js#L180
Alternatives: Ensure number of tests per file is low enough via a lint rule.
More context: https://github.com/netlify/cli/issues/4178