Browse Source
test(neutrino): tests for start and stop methods
renovate/lint-staged-8.x
Tom Kirkpatrick
7 years ago
No known key found for this signature in database
GPG Key ID: 72203A8EC5967EA8
1 changed files with
29 additions and
0 deletions
-
test/unit/lnd/neutrino.spec.js
|
|
@ -168,4 +168,33 @@ describe('Neutrino', function() { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
describe('.start', () => { |
|
|
|
describe('called when neutrino is already running', () => { |
|
|
|
beforeEach(() => { |
|
|
|
this.neutrino = new Neutrino() |
|
|
|
this.neutrino.process = 123 |
|
|
|
}) |
|
|
|
it('should throw an error', () => { |
|
|
|
expect(() => { |
|
|
|
this.neutrino.start() |
|
|
|
}).toThrow() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
describe('.stop', () => { |
|
|
|
describe('called when neutrino is already running', () => { |
|
|
|
beforeEach(() => { |
|
|
|
this.neutrino = new Neutrino() |
|
|
|
this.neutrino.process = { |
|
|
|
kill: jest.fn() |
|
|
|
} |
|
|
|
this.neutrino.stop() |
|
|
|
}) |
|
|
|
it('should kill the neutrino process', () => { |
|
|
|
expect(this.neutrino.process).toBeNull() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|