Skip to content

Commit

Permalink
fix(vue2-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 2afdad4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vue2-jest/lib/utils.js
Expand Up @@ -104,6 +104,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 2afdad4

Please sign in to comment.