test: remove 'remote' usage from process tests (#20418)
This commit is contained in:
parent
ccff140046
commit
87bd0501c4
2 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
const { remote } = require('electron')
|
||||
const { ipcRenderer } = require('electron')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
|
@ -89,8 +89,8 @@ describe('process module', () => {
|
|||
})
|
||||
|
||||
describe('process.takeHeapSnapshot()', () => {
|
||||
it('returns true on success', () => {
|
||||
const filePath = path.join(remote.app.getPath('temp'), 'test.heapsnapshot')
|
||||
it('returns true on success', async () => {
|
||||
const filePath = path.join(await ipcRenderer.invoke('get-temp-dir'), 'test.heapsnapshot')
|
||||
|
||||
const cleanup = () => {
|
||||
try {
|
||||
|
|
|
@ -42,6 +42,8 @@ ipcMain.on('message', function (event, ...args) {
|
|||
event.sender.send('message', ...args)
|
||||
})
|
||||
|
||||
ipcMain.handle('get-temp-dir', () => app.getPath('temp'))
|
||||
|
||||
// Set productName so getUploadedReports() uses the right directory in specs
|
||||
if (process.platform !== 'darwin') {
|
||||
crashReporter.productName = 'Zombies'
|
||||
|
|
Loading…
Reference in a new issue