diff --git a/test/unit/__mocks__/keytar.js b/test/unit/__mocks__/keytar.js index a0d6167a97e..47d75df35ac 100644 --- a/test/unit/__mocks__/keytar.js +++ b/test/unit/__mocks__/keytar.js @@ -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() diff --git a/webpack/webpack.config.e2e.js b/webpack/webpack.config.e2e.js index 743491d7084..b143d6fec8a 100644 --- a/webpack/webpack.config.e2e.js +++ b/webpack/webpack.config.e2e.js @@ -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