Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ pids
*.pid.lock

package-lock.json
/e2e/**/yarn.lock

5 changes: 3 additions & 2 deletions e2e/__projects__/babel-in-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test": "jest --no-cache test.js"
},
"dependencies": {
"source-map": "0.5.6",
"vue": "^2.5.21",
"vue-template-compiler": "^2.5.21"
},
Expand All @@ -16,7 +17,7 @@
"@babel/preset-env": "^7.2.3",
"@vue/test-utils": "^1.0.5",
"jest": "^24.0.0",
"vue-jest": "file:../../../"
"ts-jest": "^26.3.0"
},
"jest": {
"moduleFileExtensions": [
Expand All @@ -26,7 +27,7 @@
],
"transform": {
"^.+\\.js$": "babel-jest",
"^.+\\.vue$": "vue-jest"
"^.+\\.vue$": "file:../../../"
}
},
"babel": {
Expand Down
4,442 changes: 4,442 additions & 0 deletions e2e/__projects__/babel-in-package/yarn.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions e2e/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ function runTest(dir) {
log('Removing node_modules')
fs.removeSync(`${resolvedPath}/node_modules`)

log('Removing package-lock.json')
fs.removeSync(`${resolvedPath}/package-lock.json`)
log('Removing yarn.lock')
fs.removeSync(`${resolvedPath}/yarn.lock`)

log('Installing node_modules')
run('npm install --silent')
run('yarn install --silent')
}

// For tests that need vue-jest to successfully `require.resolve()` a file in
Expand All @@ -62,7 +62,7 @@ function runTest(dir) {
}

log('Running tests')
run('npm run test')
run('yarn test')

success(`(${dir}) Complete`)
}
Expand Down
3 changes: 1 addition & 2 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const splitRE = /\r?\n/g

const VueTemplateCompiler = require('vue-template-compiler')
const generateSourceMap = require('./generate-source-map')
const typescriptTransformer = require('./transformers/typescript')
const coffeescriptTransformer = require('./transformers/coffee')
const _processStyle = require('./process-style')
const processCustomBlocks = require('./process-custom-blocks')
Expand All @@ -18,7 +17,7 @@ const generateCode = require('./generate-code')
function resolveTransformer(lang = 'js', vueJestConfig) {
const transformer = getCustomTransformer(vueJestConfig['transform'], lang)
if (/^typescript$|tsx?$/.test(lang)) {
return transformer || typescriptTransformer
return transformer || require('./transformers/typescript')
} else if (/^coffee$|coffeescript$/.test(lang)) {
return transformer || coffeescriptTransformer
} else {
Expand Down
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"@vue/test-utils": "^1.0.5",
"@vue/test-utils": "^1.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"coffeescript": "^2.3.2",
Expand All @@ -56,23 +56,30 @@
"sass": "^1.23.7",
"semantic-release": "^15.13.2",
"stylus": "^0.54.5",
"ts-jest": "^26.3.0",
"typescript": "^3.2.2",
"vue": "^2.4.2",
"vue-template-compiler": "^2.4.2"
},
"peerDependencies": {
"@babel/core": "7.x",
"babel-jest": ">= 24 < 27",
"jest": "26.x",
"ts-jest": ">= 24 < 27 ",
"vue": "^2.x",
"vue-template-compiler": "^2.x"
},
"peerDependenciesMeta": {
"ts-jest": {
"optional": true
}
},
"dependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
"@vue/component-compiler-utils": "^3.1.0",
"chalk": "^2.1.0",
"extract-from-css": "^0.4.4",
"source-map": "0.5.6",
"ts-jest": "26.x"
"source-map": "0.5.6"
},
"repository": {
"type": "git",
Expand Down
32 changes: 21 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,9 @@
"@types/istanbul-lib-coverage" "*"

"@types/istanbul-reports@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a"
version "1.1.2"
resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz#e875cc689e47bce549ec81f3df5e6f6f11cfaeb2"
integrity sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==
dependencies:
"@types/istanbul-lib-coverage" "*"
"@types/istanbul-lib-report" "*"
Expand All @@ -1214,9 +1215,9 @@
"@types/istanbul-lib-report" "*"

"@types/jest@26.x":
version "26.0.13"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.13.tgz#5a7b9d5312f5dd521a38329c38ee9d3802a0b85e"
integrity sha512-sCzjKow4z9LILc6DhBvn5AkIfmQzDZkgtVVKmGwVrs5tuid38ws281D4l+7x1kP487+FlKDh5kfMZ8WSPAdmdA==
version "26.0.14"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.14.tgz#078695f8f65cb55c5a98450d65083b2b73e5a3f3"
integrity sha512-Hz5q8Vu0D288x3iWXePSn53W7hAjP0H7EQ6QvDO9c7t46mR0lNOLlfuwQ+JkVxuhygHzlzPX+0jKdA3ZgSh+Vg==
dependencies:
jest-diff "^25.2.1"
pretty-format "^25.2.1"
Expand Down Expand Up @@ -1275,10 +1276,10 @@
source-map "~0.6.1"
vue-template-es2015-compiler "^1.9.0"

"@vue/test-utils@^1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.5.tgz#676e1f986bb93ddc869d9c6cf1c820183d64d92f"
integrity sha512-P2x8kXwqfTXesAdfJQN146V1S3QD3Xv9wYZ1B09Oecmg7I3Fpqqo1CwfIn5ivwuXyBPQWFDH4vyBHynnYjIkRg==
"@vue/test-utils@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.1.0.tgz#76305e73a786c921ede1352849614e26c7113f94"
integrity sha512-M+3jtVqNYIrvzO5gaxogre5a5+96h0hN/dXw+5Lj0t+dp6fAhYcUjpLrC9j9cEEkl2Rcuh/gKYRUmR5N4vcqPw==
dependencies:
dom-event-types "^1.0.0"
lodash "^4.17.15"
Expand Down Expand Up @@ -1943,6 +1944,7 @@ browserslist@^4.8.3, browserslist@^4.8.5, browserslist@^4.9.1:
bs-logger@0.x:
version "0.2.6"
resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8"
integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==
dependencies:
fast-json-stable-stringify "2.x"

Expand Down Expand Up @@ -5442,7 +5444,14 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"

json5@2.x, json5@^2.1.0:
json5@2.x:
version "2.1.3"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43"
integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==
dependencies:
minimist "^1.2.5"

json5@^2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.2.tgz#43ef1f0af9835dd624751a6b7fa48874fb2d608e"
dependencies:
Expand Down Expand Up @@ -6037,6 +6046,7 @@ make-dir@^3.0.0:
make-error@1.x:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==

make-fetch-happen@^5.0.0:
version "5.0.2"
Expand Down Expand Up @@ -9014,7 +9024,7 @@ trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"

ts-jest@26.x:
ts-jest@^26.3.0:
version "26.3.0"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.3.0.tgz#6b2845045347dce394f069bb59358253bc1338a9"
integrity sha512-Jq2uKfx6bPd9+JDpZNMBJMdMQUC3sJ08acISj8NXlVgR2d5OqslEHOR2KHMgwymu8h50+lKIm0m0xj/ioYdW2Q==
Expand Down