Skip to content

Commit a92bc30

Browse files
authored
fix(webdriverio): add expect-webdriverio to tsconfig (#6309)
1 parent 8670997 commit a92bc30

File tree

2 files changed

+12
-2
lines changed
  • packages/@vue

2 files changed

+12
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
module.exports = (api) => {
22
if (api.fromVersion('<= 5.0.0-alpha.4')) {
3-
api.render(files => {
3+
api.render((files) => {
44
if (!files['tsconfig.json']) {
55
return
66
}
77

8-
files['tsconfig.json'] = files['tsconfig.json'].replace('"@wdio/sync"', '"webdriverio/sync"')
8+
files['tsconfig.json'] = files['tsconfig.json'].replace(
9+
'"@wdio/sync"',
10+
'"webdriverio/sync"'
11+
)
12+
if (!/"expect-webdriverio"/.test(files['tsconfig.json'])) {
13+
files['tsconfig.json'] = files['tsconfig.json'].replace(
14+
'"@wdio/mocha-framework",',
15+
'"@wdio/mocha-framework",\n "expect-webdriverio",'
16+
)
17+
}
918
})
1019
}
1120
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<%_ if (hasWebDriverIO) { _%>
2626
<% if (!hasMocha && !hasJest) { %>"mocha",<% } %>
2727
"@wdio/mocha-framework",
28+
"expect-webdriverio",
2829
"webdriverio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
2930
<%_ } _%>
3031
<%_ if (hasMocha) { _%>

0 commit comments

Comments
 (0)