Skip to content

Commit

Permalink
update test for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mholtzman committed Oct 19, 2021
1 parent 5378fad commit d000508
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/main/signers/ledger/adapter.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os from 'os'
import log from 'electron-log'
import HID from 'node-hid'
import usbDetect from 'usb-detection'

import LedgerSignerAdapter from '../../../../main/signers/ledger/adapter'
import { Status } from '../../../../main/signers/ledger/Ledger'
import log from 'electron-log'
import usbDetect from 'usb-detection'

jest.mock('node-hid')

Expand Down Expand Up @@ -66,7 +68,11 @@ afterEach(() => {
})

afterAll(() => {
usbDetect.stopMonitoring()
if (os.platform().toLowerCase() !== 'linux') {
// calling stopMonitoring() causes a segmentation fault on Linux
// https://github.com/MadLittleMods/node-usb-detection/issues/57
usbDetect.stopMonitoring()
}

jest.useRealTimers()
log.transports.console.level = 'debug'
Expand Down

0 comments on commit d000508

Please sign in to comment.