Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF committed Mar 18, 2024
1 parent 4839fb8 commit 45c0c34
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/core/__tests__/BackgroundProcessManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ describe('BackgroundProcessManager', () => {
const manager = new BackgroundProcessManager();
let count = 0;

const _ = new Observable(observer => {
new Observable(observer => {
const interval = setInterval(() => {
observer.next({});
}, 10);
Expand Down
15 changes: 9 additions & 6 deletions packages/core/__tests__/ConsoleLogger.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { ConsoleLogger } from '../src';
import { LoggingProvider, LogType } from '../src/Logger/types';
import { LogType, LoggingProvider } from '../src/Logger/types';

type LogEvent = 'verbose' | 'debug' | 'info' | 'warn' | 'error';

describe('ConsoleLogger', () => {
const noop = () => {
// no op
};
beforeAll(() => {
jest.spyOn(console, 'log').mockImplementation(() => {});
jest.spyOn(console, 'error').mockImplementation(() => {});
jest.spyOn(console, 'warn').mockImplementation(() => {});
jest.spyOn(console, 'info').mockImplementation(() => {});
jest.spyOn(console, 'debug').mockImplementation(() => {});
jest.spyOn(console, 'log').mockImplementation(noop);
jest.spyOn(console, 'error').mockImplementation(noop);
jest.spyOn(console, 'warn').mockImplementation(noop);
jest.spyOn(console, 'info').mockImplementation(noop);
jest.spyOn(console, 'debug').mockImplementation(noop);
});
afterEach(() => {
jest.clearAllMocks();
Expand Down
8 changes: 4 additions & 4 deletions packages/core/__tests__/clients/composeApiHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ describe(composeServiceApi.name, () => {
const mockTransferHandler = jest.fn().mockResolvedValue(defaultResponse);
const api = composeServiceApi(
mockTransferHandler,
_ => defaultRequest,
async _ => ({
() => defaultRequest,
async () => ({
Result: 'from API',
}),
defaultConfig,
Expand All @@ -47,8 +47,8 @@ describe(composeServiceApi.name, () => {
};
const api = composeServiceApi(
mockTransferHandler,
__ => defaultRequest,
async __ => ({
() => defaultRequest,
async () => ({
Result: 'from API',
}),
defaultConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,13 @@ describe('createQueuedStorage', () => {

describe('method add()', () => {
let queuedStorage: QueuedStorage;
// let originalDate;
let dateNowSpy: jest.SpyInstance;
const testInput: ItemToAdd = {
content: 'some log content',
timestamp: mockTimestamp,
};

beforeAll(() => {
// originalDate = Date;
// Date = {
// now: jest.fn(() => 123),
// } as any;
dateNowSpy = jest.spyOn(Date, 'now').mockReturnValue(123);
queuedStorage = createQueuedStorage();
});
Expand Down

0 comments on commit 45c0c34

Please sign in to comment.