Skip to content

Commit

Permalink
simple test to start and stop geth (#30)
Browse files Browse the repository at this point in the history
@corn-potage for the work!
  • Loading branch information
corn-potage authored May 4, 2022
1 parent 3f9583e commit 14ba54f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/__tests__/node/geth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import path from 'path';

// import { gethBuildNameForPlatformAndArch } from '../main/gethDownload';
import { getNNDirPath } from '../../main/files';
import { downloadGeth } from '../../main/geth';
import { downloadGeth, getStatus, startGeth, stopGeth } from '../../main/geth';
import { gethBuildNameForPlatformAndArch } from '../../main/gethDownload';
import { NODE_STATUS } from '../../main/messenger';

jest.mock('electron', () => {
return {
Expand Down Expand Up @@ -82,3 +83,15 @@ describe('Downloading geth', () => {
}
});
});

describe('Starting and stopping geth', () => {
it('Successfully starts and stops', async () => {
// start child process
await startGeth();
expect(getStatus()).toBe(NODE_STATUS.running);

// stop child process
await stopGeth();
expect(getStatus()).toBe(NODE_STATUS.stopped);
});
});

0 comments on commit 14ba54f

Please sign in to comment.