Use karma as a static server as well as a test runner!
$ npm install --save-dev karma-static-server
Then edit your karma.conf.js so that
staticServeris in middleware:
You will also want to change the karma
urlRootso that karma does not take over the root path, IE:
Now karma will run test on
You may also need to include it in plugins, if you are manually specifying them. By default karma will include all packages that match
"plugins": ["karma-*"], // or "plugins": [ ... "karma-static-server" ... ],
Now when you run karma you will also get a static server for the
basePathyou have set in your karma config. To configure that see below.
OptionsMost options are passed directly to
serve-static, other than those listed.
stringDefault: karma basePath
Where to serve files out of
booleanDefault: false during singleRun, false otherwise
Use the karma log to log static responses, and log that we are seving static files.