Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
test: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
okdistribute committed Feb 17, 2020
1 parent 66b7885 commit c1e68a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const stat = promisify(fs.stat)

function showOpenDialog (props) {
if (process.env.RUNNING_IN_SPECTRON && process.env.OPEN_RESULT) {
return [path.resolve(__dirname, process.env.OPEN_RESULT)]
return new Promise((resolve, reject) => {
resolve({
cancelled: false,
filePaths: [path.resolve(__dirname, process.env.OPEN_RESULT)]
})
})
}
return remote.dialog.showOpenDialog(props)
}
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ app.on('ready', () => {
nodeIntegration: false,
preload: `${__dirname}/preload.js`
}
: {}
: {
nodeIntegration: true
}
)
})
win.loadURL(`file://${__dirname}/index.html#${process.env.NODE_ENV}`)
Expand Down
2 changes: 1 addition & 1 deletion tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('init', function (t) {
isFocused: true,
bounds: {
width: 800,
height: 600
height: 601
}
},
'All settings match'
Expand Down

0 comments on commit c1e68a1

Please sign in to comment.