Skip to content

Commit

Permalink
fix(middleware): fix file type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
falsandtru committed May 6, 2020
1 parent a3d1f11 commit 4c7bc2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/middleware/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function createKarmaMiddleware (
const scriptTags = []
for (const file of files.included) {
let filePath = file.path
const fileType = file.type || path.extname(filePath).substring(1)
const fileType = file.type || path.extname(filePath.split(/[?#]/, 1)[0] || '').substring(1)

if (helper.isDefined(fileType) && !FILE_TYPES.includes(fileType)) {
log.warn(`Invalid file type (${fileType}), defaulting to js.`)
Expand Down

0 comments on commit 4c7bc2f

Please sign in to comment.