Skip to content
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

Allow tests to be ran with dummy Babel compilation #1605

Closed
wants to merge 1 commit into from

Conversation

bguerout
Copy link

@bguerout bguerout commented Dec 5, 2017

Hi there,

Based on the discussions in #709 and #1556, here is a pull-request to by pass the babel compilation. This is mostly inspired by https://github.com/andywer/ava-ts.

It adds a compileJavascriptFiles option to switch between CachingPrecompiler and NativeCachingPrecompiler. Instead of calling babel.transform, this new class just returns native code by calling toString() function.
We tested this pull-request against our tests and we were able to debug our code without source mapping issue. Note that we don't use Babel in our project.

This pull request is not ready to be merged (no tests,...). This is mostly to share with you a way to by pass Babel compilation. Is this the right way to do it or do you have another solutions in mind?

@novemberborn
Copy link
Member

Hey @bguerout, thanks for the PR!

I'm leaning towards the solution proposed in #1556 (comment) — as you've probably noticed I haven't cleaned up the existing issues to clarify the intended approach. Does this solution seem good to you?

@bguerout
Copy link
Author

bguerout commented Dec 5, 2017

Thanks for your feedback @novemberborn
I'm not sure to understand how transpileEnhancements and babel options will be used.
Nevertheless feel free to close this pull request.
We can still discuss about theses options into #1556

@novemberborn
Copy link
Member

I'm not sure to understand how transpileEnhancements and babel options will be used.

In essence I'm proposing to break up compileJavascriptFiles into transpileEnhancements || babel. So you can opt out of Babel transforms with regards to syntax support, but it's surprising if that disables other advertised AVA features. Features we may want to apply if down the line we have built-in TypeScript support, for instance. You'd have to explicitly disable those features, and with both flags set to false AVA wouldn't transpile test files at all.

@bguerout
Copy link
Author

bguerout commented Dec 5, 2017

Ok sounds good to me.

@novemberborn
Copy link
Member

@bguerout cool! Would you like to take that on, in lieu of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants