Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschakki committed Dec 21, 2023
1 parent 235f6b7 commit d1a33a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions framework/test/unit/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as childProcess from 'child_process';
import * as fs from 'fs-extra';
import * as os from 'os';
import { join } from 'path';
import { Modules, BasePlugin } from '../../src';
import { Modules, Plugins } from '../../src';
import { Application } from '../../src/application';
import { Bus } from '../../src/controller/bus';
import { WSServer } from '../../src/controller/ws/ws_server';
Expand Down Expand Up @@ -46,7 +46,7 @@ jest.mock('zeromq', () => {
jest.mock('@liskhq/lisk-db');
jest.mock('../../src/logger');

class TestPlugin extends BasePlugin {
class TestPlugin extends Plugins.BasePlugin {
public get nodeModulePath(): string {
return __filename;
}
Expand Down
14 changes: 7 additions & 7 deletions framework/test/unit/controller/bus.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import * as fs from 'fs-extra';
import { Bus } from '../../../src/controller/bus';
import { Request } from '../../../src/controller/request';
import { IPCServer } from '../../../src/controller/ipc/ipc_server';
import { EndpointInfo } from '../../../src';
import { Types } from '../../../src';
import { InvokeRequest } from '../../../src/controller/channels/base_channel';

jest.mock('ws');
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('Bus', () => {
it('should register actions.', async () => {
// Arrange
const moduleName = 'name';
const endpointInfo: { [key: string]: EndpointInfo } = {
const endpointInfo: { [key: string]: Types.EndpointInfo } = {
action1: {
namespace: 'name',
method: 'action1',
Expand All @@ -160,7 +160,7 @@ describe('Bus', () => {
it('should throw error when trying to register duplicate actions.', async () => {
// Arrange
const moduleName = 'name';
const endpointInfo: { [key: string]: EndpointInfo } = {
const endpointInfo: { [key: string]: Types.EndpointInfo } = {
action1: {
namespace: 'name',
method: 'action1',
Expand All @@ -179,7 +179,7 @@ describe('Bus', () => {
it('should invoke the action on the channel.', async () => {
// Arrange
const moduleName = 'name';
const endpointInfo: { [key: string]: EndpointInfo } = {
const endpointInfo: { [key: string]: Types.EndpointInfo } = {
action1: {
namespace: 'name',
method: 'action1',
Expand All @@ -196,7 +196,7 @@ describe('Bus', () => {
it('should throw error when invoking an action on the channel with an invalid context.', async () => {
// Arrange
const moduleName = 'name';
const endpointInfo: { [key: string]: EndpointInfo } = {
const endpointInfo: { [key: string]: Types.EndpointInfo } = {
action1: {
namespace: 'name',
method: 'action1',
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('Bus', () => {

it('should return a result of undefined when an empty context and action params are passed to a registered channel', async () => {
const moduleName = 'name';
const endpointInfo: { [key: string]: EndpointInfo } = {
const endpointInfo: { [key: string]: Types.EndpointInfo } = {
action1: {
namespace: 'name',
method: 'action1',
Expand Down Expand Up @@ -395,7 +395,7 @@ describe('Bus', () => {
it('should return the registered actions', async () => {
// Arrange
const moduleName = 'name';
const endpointInfo: { [key: string]: EndpointInfo } = {
const endpointInfo: { [key: string]: Types.EndpointInfo } = {
action1: {
namespace: 'name',
method: 'action1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { utils } from '@liskhq/lisk-cryptography';
import { codec } from '@liskhq/lisk-codec';
import { InMemoryDatabase } from '@liskhq/lisk-db';
import { LegacyConfig } from '../../../../src';
import { Types } from '../../../../src';
import { LegacyChainHandler } from '../../../../src/engine/legacy/legacy_chain_handler';
import { Network } from '../../../../src/engine/network';
import { encodeBlock } from '../../../../src/engine/legacy/codec';
Expand All @@ -30,7 +30,7 @@ const expectedSnapshotBlockID = utils.getRandomBytes(20);

describe('Legacy Chain Handler', () => {
let legacyChainHandler: LegacyChainHandler;
let legacyConfig: LegacyConfig;
let legacyConfig: Types.LegacyConfig;
let peers: Peer[];
let network: Network;
let legacyBlock16270316: LegacyBlock;
Expand Down
6 changes: 3 additions & 3 deletions framework/test/unit/plugins/base_plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*/

import * as apiClient from '@liskhq/lisk-api-client';
import { BasePlugin, GenesisConfig, systemDirs, testing } from '../../../src';
import { Plugins, Types, systemDirs, testing } from '../../../src';
import * as loggerModule from '../../../src/logger';
import { getPluginExportPath } from '../../../src/plugins/base_plugin';
import { fakeLogger } from '../../utils/mocks';

class MyPlugin extends BasePlugin {
class MyPlugin extends Plugins.BasePlugin {
public configSchema = {
$id: '/myPlugin/schema',
type: 'object',
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('base_plugin', () => {
plugin.init({
appConfig: {
...testing.fixtures.defaultConfig,
genesis: {} as unknown as GenesisConfig,
genesis: {} as unknown as Types.GenesisConfig,
},
logger: fakeLogger,
config: {
Expand Down

0 comments on commit d1a33a0

Please sign in to comment.