-
Notifications
You must be signed in to change notification settings - Fork 220
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
fix(karma-webpack): correctly map entries
to outputted assets
(config.output
)
#348
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
michael-ciniawsky
changed the title
fix(karma-webpack): correctly map
fix(karma-webpack): correctly map Sep 3, 2018
entries
to outputted assets
(config.output
) for v3entries
to outputted assets
(config.output
)
src/karma-webpack.js
Outdated
var assetKeys = Object.keys(stats.assetsByChunkName) | ||
for (let i = 0; i < assetKeys.length; i++) { | ||
var entryName = assetKeys[i] | ||
if (Object.prototype.hasOwnProperty.call(this.entryFilesMap, entryName)) { |
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 ({}.hasOwnProperty.call(..., ...))
michael-ciniawsky
approved these changes
Sep 3, 2018
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.
👍
michael-ciniawsky
added
status: Approved
and removed
priority: 4 (important)
severity: 3 (broken)
status: Pending
labels
Sep 3, 2018
Released in |
This was referenced Sep 3, 2018
Merged
While this correctly fixes the issue there should be unit tests to prove it works tomorrow too |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue with tests not running due to the filename being the default value (
[name].js
).Issue stemmed from the entry files being added and their name being set to the full path, including file extension. This means that webpack would store the file in memory with a double extension (
filename.js.js
).This changes the code so the entry file's name no longer includes the extension.
It also fixes the issue with files with the extension
.ts
(and any other extension, such as.coffee
)having to use karma's
mime
configuration to run the tests due to webpack outputting a.ts
file - this is no longer needed as the entry files are mapped to their outputted asset file from webpack's stats. This way if you usetests/**/*.ts
with the default filename setting of[name].js
, webpack will output the test files astests/**/*.js
, and update karma to point to the.js
files in the browser.This fixes this comment - #322 (comment) - but I don't think the actual issue is related to the comment.
Type
Issues
SemVer