Skip to content

Commit 87bd050

Browse files
authored
test: remove 'remote' usage from process tests (electron#20418)
1 parent ccff140 commit 87bd050

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

spec/api-process-spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { remote } = require('electron')
1+
const { ipcRenderer } = require('electron')
22
const fs = require('fs')
33
const path = require('path')
44

@@ -89,8 +89,8 @@ describe('process module', () => {
8989
})
9090

9191
describe('process.takeHeapSnapshot()', () => {
92-
it('returns true on success', () => {
93-
const filePath = path.join(remote.app.getPath('temp'), 'test.heapsnapshot')
92+
it('returns true on success', async () => {
93+
const filePath = path.join(await ipcRenderer.invoke('get-temp-dir'), 'test.heapsnapshot')
9494

9595
const cleanup = () => {
9696
try {

spec/static/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ ipcMain.on('message', function (event, ...args) {
4242
event.sender.send('message', ...args)
4343
})
4444

45+
ipcMain.handle('get-temp-dir', () => app.getPath('temp'))
46+
4547
// Set productName so getUploadedReports() uses the right directory in specs
4648
if (process.platform !== 'darwin') {
4749
crashReporter.productName = 'Zombies'

0 commit comments

Comments
 (0)