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 11, 2019
1 parent 56f2169 commit 404036a
Show file tree
Hide file tree
Showing 2 changed files with 9 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
8 changes: 8 additions & 0 deletions webpack/webpack.config.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
* 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
// TODO remove and add support for linux in e2e
if (os.platform() === 'linux') {
prodConfig[2].resolve.alias['keytar'] = path.resolve(__dirname, '../test/unit/__mocks__/keytar')
}

export default prodConfig

0 comments on commit 404036a

Please sign in to comment.