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

Better build system for tests #3543

Closed
gkatsev opened this issue Aug 17, 2016 · 5 comments
Closed

Better build system for tests #3543

gkatsev opened this issue Aug 17, 2016 · 5 comments

Comments

@gkatsev
Copy link
Member

gkatsev commented Aug 17, 2016

As part of #3445, the normal files are compiled using babel into an es5/ folder and then browserified into the dist/ folder for users who aren't using browserify directly.
However, the way the tests are build right now is that they're built separately via browserify with babelify through a karma plugin.
Probably, we'd want to apply a similar build step to the tests as we did for the source files. It gets slightly tricky because the test files require into src/ directly rather than the es5/ folder. One potential solution is to move the test files to be siblings of the normal source files, so, then, they can just require the sibling file and the build is easy. @videojs/core-committers thoughts on this change to the test files?
But as part of this, we'd want to investigate if we can keep the test build system similar to the src files.

@gkatsev gkatsev modified the milestones: 100% Spec Coverage, 3.12 build-improvements Aug 17, 2016
@brandonocasey
Copy link
Contributor

So we just want to be able to run the tests via karma and in the browser. I think we should do something more like what the generator does and have karma use the es5 bundle, and the browser also use that same bundle

@gkatsev
Copy link
Member Author

gkatsev commented Aug 17, 2016

@brandonocasey if I'm reading it right, it still gets browserified separately and doesn't actually use the es5 code.

@heff
Copy link
Member

heff commented Aug 18, 2016

I don't know what the specific downsides are but moving tests next to their source files seems convenient, and we did talk about trying to componentize/modularize things more in the source at one point. That might have been more about putting the CSS next to the source files, but similar concept. Feels like something you get 90% of the way through and then realize all the downsides. :)

@gkatsev
Copy link
Member Author

gkatsev commented Aug 18, 2016

Yeah, very similar.
In this case, it seems like there are more benefits than downsides, also, the test folder could be put inside of the src/js folder and it could still probably work while being more contained because the relative paths would be the same whether they were in src/js/test/ or in es5/test.

If there isn't objection about this, I can put together a PoC for this, though, this one probably shouldn't hold back the release.

@gkatsev
Copy link
Member Author

gkatsev commented Jan 3, 2018

I don't think we want to go down this route anymore.

@gkatsev gkatsev closed this as completed Jan 3, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants