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 fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
|
@ -89,8 +89,8 @@ describe('process module', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('process.takeHeapSnapshot()', () => {
|
describe('process.takeHeapSnapshot()', () => {
|
||||||
it('returns true on success', () => {
|
it('returns true on success', async () => {
|
||||||
const filePath = path.join(remote.app.getPath('temp'), 'test.heapsnapshot')
|
const filePath = path.join(await ipcRenderer.invoke('get-temp-dir'), 'test.heapsnapshot')
|
||||||
|
|
||||||
const cleanup = () => {
|
const cleanup = () => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -42,6 +42,8 @@ ipcMain.on('message', function (event, ...args) {
|
||||||
event.sender.send('message', ...args)
|
event.sender.send('message', ...args)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ipcMain.handle('get-temp-dir', () => app.getPath('temp'))
|
||||||
|
|
||||||
// Set productName so getUploadedReports() uses the right directory in specs
|
// Set productName so getUploadedReports() uses the right directory in specs
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
crashReporter.productName = 'Zombies'
|
crashReporter.productName = 'Zombies'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue