-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Ava does not transpile helpers! #1319
Comments
I think I might have discovered the problem: We have the following code in this line: Line 90 in 4b6323e
const defaultHelperPatterns = () => [
'**/__tests__/helpers/**/*.js',
'**/__tests__/**/_*.js',
'**/test/helpers/**/*.js',
'**/test/**/_*.js'
]; This globs do not cover a case like const defaultHelperPatterns = () => [
'**/__tests__/**/helpers/**/*.js',
'**/__tests__/**/_*.js',
'**/test/**/helpers/**/*.js',
'**/test/**/_*.js'
]; Am I thinking this right? |
Just tested, and my previous comment works! Gonna open the PR :) |
I think we should solve this by improving how test files are selected, and letting users specify patterns that match |
With the new Node LTS as our baseline we don't really have to do extra transpilation. ava still does its own but it does so inconsistently ( avajs/ava#1319 ), so we've switched back from import to require(). Indeed ava might get an option to turn off transpilation altogether ( avajs/ava#1556 ), which we may end up using if it doesn't come with bad tradeoffs.
See #2105. |
Description
Ava should transpile helper files without requiring
babel-register
or any such a thing.If the test files are inside a
test
folder, this works.However: if the files are inside another folder (e.g:
my-tests
instead oftest
) or are inside a subfolder (e.g:test/unit
) this does not work.TLDR: If tests are inside a subfolder of
test
directory, ava DOES NOT TRANSPILE helper filesTest Source
Error Message & Stack Trace
Config
No configuration, which means no babel-register or such things
Command-Line Arguments
Relevant Links
Repo with detailed instructions to reproduce the behavior: https://github.com/wasting-light/avajs-bug-report-x89
Environment
Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:
The text was updated successfully, but these errors were encountered: