Skip to content

Commit

Permalink
fix(vue3-jest): interop custom transformer require (#391)
Browse files Browse the repository at this point in the history
interop custom transformer require. Some transformers may not interop correctly
when requiring, return `transformer.default` or `transformer`.

fixes #383
  • Loading branch information
blake-newman authored Nov 28, 2021
1 parent 6e76d59 commit 5741877
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vue3-jest/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const getCustomTransformer = function getCustomTransformer(
require(resolvePath(transformerPath))
) {
transformer = require(resolvePath(transformerPath))
transformer = transformer.default || transformer
} else if (typeof transformerPath === 'object') {
transformer = transformerPath
}
Expand Down

0 comments on commit 5741877

Please sign in to comment.