Skip to content

Commit

Permalink
fix(vue3-jest): interop custom transformer require
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 vuejs#383
  • Loading branch information
blake-newman committed Sep 30, 2021
1 parent 160b9f5 commit 7f74cb3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vue3-jest/lib/utils.js
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 7f74cb3

Please sign in to comment.