While working on NativeScript unit test runner, we ran into a few issues with the default config/setup of karma-webpack (5), however we were able to adjust the default config by simply patching it, so decided not to make changes & bloat karma-webpack with an extra flag/escape hatch.
One small "issue" remains with how the file.path is handled. The original (full) path is discarded, so karma-server's context.json contains:
/absolute<testname>.<hash>.js?<anotherHash>
# instead of
/base/<original-path>/<testname>.<hash>.js?<anotherHash>
# For example:
/app/tests/example.spec.js
# would become
/absoluteexample.spec.123123.js?hashhashhash
but unsure if changing that would affect anything else, we adjusted how we handle paths starting with /absolute - so no change required in karma-webpack from our end.
Breaking Changes
N/A
Additional Info
The change in controller.test.js fixes the test on non-unix systems.
The test doesn't currently cover the // one time setup block.
This PR contains a:
Motivation / Use-Case
While working on NativeScript unit test runner, we ran into a few issues with the default config/setup of karma-webpack (5), however we were able to adjust the
default
config by simply patching it, so decided not to make changes & bloat karma-webpack with an extra flag/escape hatch.One small "issue" remains with how the
file.path
is handled. The original (full) path is discarded, sokarma-server
'scontext.json
contains:but unsure if changing that would affect anything else, we adjusted how we handle paths starting with
/absolute
- so no change required inkarma-webpack
from our end.Breaking Changes
N/A
Additional Info
The change in
controller.test.js
fixes the test on non-unix systems.The test doesn't currently cover the
// one time setup
block.