Skip to content

Commit 9535c17

Browse files
committed
fix: fix webdriverio ts setup
1 parent 56bb3e0 commit 9535c17

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

packages/@vue/cli-plugin-typescript/generator/convert.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
module.exports = (api, { tsLint = false, convertJsToTs = true } = {}) => {
22
const jsRE = /\.js$/
3-
const excludeRE = /^tests\/e2e\/|(\.config|rc)\.js$/
3+
let excludeRE = /^tests\/e2e\/|(\.config|rc)\.js$/
4+
5+
if (api.hasPlugin('e2e-webdriverio')) {
6+
excludeRE = /(\.config|rc)\.js$/
7+
}
48
const convertLintFlags = require('../lib/convertLintFlags')
59
api.postProcessFiles(files => {
610
if (convertJsToTs) {

packages/@vue/cli-plugin-typescript/generator/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ module.exports = (api, {
9393
api.render('./template', {
9494
skipLibCheck,
9595
hasMocha: api.hasPlugin('unit-mocha'),
96-
hasJest: api.hasPlugin('unit-jest')
96+
hasJest: api.hasPlugin('unit-jest'),
97+
hasWebDriverIO: api.hasPlugin('e2e-webdriverio')
9798
})
9899

99100
if (isVue3) {

packages/@vue/cli-plugin-typescript/generator/template/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
"sourceMap": true,
2121
"baseUrl": ".",
2222
"types": [
23-
"webpack-env"<% if (hasMocha || hasJest) { %>,<% } %>
23+
"webpack-env"<% if (hasMocha || hasJest || hasWebDriverIO) { %>,<% } %>
24+
<%_ if (hasWebDriverIO) { _%>
25+
"@wdio/mocha-framework",
26+
"@wdio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
27+
<%_ } _%>
2428
<%_ if (hasMocha) { _%>
2529
"mocha",
2630
"chai"

0 commit comments

Comments
 (0)