codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 221 forks source link

Add livereload capability for html reporters like karma-jasmine-html-reporter #499

Closed sprilukin closed 3 years ago

sprilukin commented 3 years ago

Feature Proposal

Add live reload capability for reporters which run inside a browser like karma-jasmine-html-reporter. See attached gif to understood how I expect it to work:

karma-webpack

Feature Use Case

If I'm running unit tests in a browser with some kind of an HTML reporter I want the ability to automatically refresh the browser page once source code or test code is chanage to immediately see results in the browser.

Currently, i have to manually refresh the page a couple of times until changes are picked up by the browser.

Sample

I've prepared a sample repo. It demonstrates current behavior and expected behavior.

To check current behavior:
To check expected behavior:

Here i used modified version of the karma-webpack library to support livereload Modified karma-webpack repo could be found here: [https://github.com/sprilukin/karma-webpack]() Also i created PR #500 which could be used as a base for this feature

sprilukin commented 3 years ago

For those who are eager to test this feature - i've created karma plugin based on karma-webpack: https://github.com/sprilukin/karma-webpack-livereload