Skip to content

Commit

Permalink
fix(webdriverio): add expect-webdriverio to tsconfig (#6309)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored Feb 23, 2021
1 parent 8670997 commit a92bc30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/@vue/cli-plugin-e2e-webdriverio/migrator/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
module.exports = (api) => {
if (api.fromVersion('<= 5.0.0-alpha.4')) {
api.render(files => {
api.render((files) => {
if (!files['tsconfig.json']) {
return
}

files['tsconfig.json'] = files['tsconfig.json'].replace('"@wdio/sync"', '"webdriverio/sync"')
files['tsconfig.json'] = files['tsconfig.json'].replace(
'"@wdio/sync"',
'"webdriverio/sync"'
)
if (!/"expect-webdriverio"/.test(files['tsconfig.json'])) {
files['tsconfig.json'] = files['tsconfig.json'].replace(
'"@wdio/mocha-framework",',
'"@wdio/mocha-framework",\n "expect-webdriverio",'
)
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<%_ if (hasWebDriverIO) { _%>
<% if (!hasMocha && !hasJest) { %>"mocha",<% } %>
"@wdio/mocha-framework",
"expect-webdriverio",
"webdriverio/sync"<% if (hasMocha || hasJest) { %>,<% } %>
<%_ } _%>
<%_ if (hasMocha) { _%>
Expand Down

0 comments on commit a92bc30

Please sign in to comment.