Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
test(e2e): use mock keytar when running e2e on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
korhaliv committed Oct 10, 2019
1 parent 64e641d commit 62d9922
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/unit/__mocks__/keytar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import set from 'lodash/set'

const db = {}

module.exports = {
export default {
setPassword(service, account, password) {
set(db, [service, account], password)
return Promise.resolve()
Expand Down
7 changes: 7 additions & 0 deletions webpack/webpack.config.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
* Webpack config for use with testcafe (e2e).
*/

import path from 'path'
import os from 'os'
import prodConfig from './webpack.config.prod'

// Disable minification for compatibility with testcafe-react-selectors.
prodConfig.map(config => {
config.optimization.minimizer = []

return config
})
// patch mainConfig. use mock keytar on linux
if (os.platform() === 'linux') {
prodConfig[2].resolve.alias['keytar'] = path.resolve(__dirname, '../test/unit/__mocks__/keytar')
}

export default prodConfig

0 comments on commit 62d9922

Please sign in to comment.