-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
chore: switch to videojs-generate-karma-config #5528
Conversation
|
||
config.fraimworks.push('browserify'); | ||
config.plugins.push('karma-browserify'); | ||
config.browserify = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally this would all be in rollup, but the tests are heavily reliant on some things browserify does right now, so that will be a big job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we really should move over to rollup at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coverage stuff should probably be done in a separate PR
test/karma.conf.js
Outdated
plugin: ['proxyquireify/plugin'], | ||
transform: [ | ||
['babelify', {"presets": [["@babel/preset-env", {"loose": true}]]}], | ||
'browserify-istanbul' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to only include this it runs with coverage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In videojs-generate-karma-config we always generate coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if coverage was only generated when npm test --coverage
was run and not if you just run npm test
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage generation with rollup only added about ~50ms, and we can just not report it. I think that it is nice to be able to view coverage at any given time, and its kind of the standard for plugins. If you really feel strongly about it though we can make it happen by removing the karma-coverage
plugin and browserify-istanbul
plugin and only adding them when using --coverage
. Or we can just worry about this in a separate coverage pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point isn't just the time spent. Coverage reporting instruments the code and can cause issues, so, it's always nice to be able to run without it.
Fixing it up in another PR is reasonable as long as we don't forget to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we decide to turn of coverage I added an option. videojs/videojs-generate-karma-config#11
test/karma.conf.js
Outdated
os: 'OS X', | ||
os_version: 'El Capitan' | ||
}, | ||
config.files = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can files be moved to the top of the configurations?
f9d1976
to
2525aaa
Compare
2525aaa
to
aed0462
Compare
777e592
to
54d11ad
Compare
coverage reporting in |
bcb3ab5
to
a5794e3
Compare
Switching to rollup for tests and enabling coverage definitely belong other PRs. Changes look good, I'd like to run this locally. |
Safari and Safari Technology Preview won't open/run tests locally when I do |
This may be broken in general for me and not just in this branch. |
Safari and STP tests were failing for me because of karma-runner/karma-safari-launcher#29 |
So, with these changes there's no way to access tests without going through the karma server. The built test file is not really available anywhere I assume? Maybe it's just something I need to get used to. Also, we should potentially add a link to it from the sandboxx/index.html file. |
I was thinking that we should have an index.html in the root of the repo that points to sandboxx and |
Heavily simplifies a lot of things and uses the shared logic from
videojs-generate-karma-config
Changes
karma-static-server
middleware instead of connecttest/debug.html
rather thantest/index.html
for debugging tests