Skip to content

Commit

Permalink
fix: Fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
yanguoyu committed Nov 16, 2023
1 parent e7d4ed0 commit 255ffd1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/neuron-wallet/tests/services/node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('NodeService', () => {
const getChainMock = jest.fn()
const getLocalNodeInfoMock = jest.fn()
const pathJoinMock = jest.fn()
const redistCheckMock = jest.fn()

const fakeHTTPUrl = 'http://fakeurl'

Expand Down Expand Up @@ -56,6 +57,7 @@ describe('NodeService', () => {
stubbedStartLightNode.mockReset()
stubbedStopLightNode.mockReset()
pathJoinMock.mockReset()
redistCheckMock.mockReset()
}

beforeEach(() => {
Expand Down Expand Up @@ -179,6 +181,8 @@ describe('NodeService', () => {
join: pathJoinMock,
}))

jest.doMock('utils/redist-check', () => redistCheckMock)

stubbedRxjsDebounceTime.mockReturnValue((x: any) => x)
getChainMock.mockRejectedValue('no chain')
})
Expand Down Expand Up @@ -351,6 +355,7 @@ describe('NodeService', () => {
nodeService.ckb.node.url = bundledNodeUrl
})
stubbedStartCKBNode.mockResolvedValue(true)
redistCheckMock.mockResolvedValue(true)
stubbedNetworsServiceGet.mockReturnValue({ remote: bundledNodeUrl, readonly: true })
getLocalNodeInfoMock.mockRejectedValue('not start')
await nodeService.tryStartNodeOnDefaultURI()
Expand Down

0 comments on commit 255ffd1

Please sign in to comment.