mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { AddressSettingsModule } from '../../ORM/address-settings/address-settings.module';
|
||||
import { ClientStatisticsModule } from '../../ORM/client-statistics/client-statistics.module';
|
||||
import { ClientModule } from '../../ORM/client/client.module';
|
||||
import { ClientController } from './client.controller';
|
||||
@@ -19,6 +20,7 @@ describe('ClientController', () => {
|
||||
cache: true,
|
||||
logging: false
|
||||
}),
|
||||
AddressSettingsModule,
|
||||
ClientModule,
|
||||
ClientStatisticsModule
|
||||
],
|
||||
|
||||
@@ -154,7 +154,8 @@ describe('StratumV1Client', () => {
|
||||
|
||||
it('should close socket on invalid JSON', () => {
|
||||
socketEmitter(Buffer.from('INVALID'));
|
||||
expect(promiseSocket.end).toHaveBeenCalledTimes(1);
|
||||
jest.spyOn(promiseSocket, 'destroy');
|
||||
expect(promiseSocket.socket.on).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should respond to mining.subscribe', async () => {
|
||||
@@ -206,7 +207,7 @@ describe('StratumV1Client', () => {
|
||||
socketEmitter(Buffer.from(MockRecording1.MINING_AUTHORIZE));
|
||||
await new Promise((r) => setTimeout(r, 100));
|
||||
|
||||
expect(promiseSocket.write).toHaveBeenCalledWith(`{"id":null,"method":"mining.set_difficulty","params":[32768]}\n`);
|
||||
expect(promiseSocket.write).toHaveBeenCalledWith(`{"id":null,"method":"mining.set_difficulty","params":[16384]}\n`);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user