Skip to content

Commit

Permalink
test: move utils test to utils module
Browse files Browse the repository at this point in the history
  • Loading branch information
erha19 committed Apr 6, 2022
1 parent b1bf9e7 commit cd8d025
Show file tree
Hide file tree
Showing 36 changed files with 103 additions and 1,221 deletions.
3 changes: 1 addition & 2 deletions packages/core-browser/src/core-preferences.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injector } from '@opensumi/di';
import { localize, getAvailableLanguages, isElectronRenderer, isWindows } from '@opensumi/ide-core-common';
import { SUPPORTED_ENCODINGS } from '@opensumi/ide-core-common/lib/const';
import { localize, getAvailableLanguages, isElectronRenderer, SUPPORTED_ENCODINGS } from '@opensumi/ide-core-common';

import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceSchema } from './preferences';

Expand Down
12 changes: 6 additions & 6 deletions packages/core-common/__tests__/event-bus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('event-bus', () => {
class AEvent extends BasicEvent<number> {}
class BEvent extends BasicEvent<string> {}

it('event bus 能够正常执行', () => {
it('event bus work', () => {
const eventBus = new EventBusImpl();
const spyA = jest.fn();
eventBus.on(AEvent, spyA);
Expand All @@ -25,7 +25,7 @@ describe('event-bus', () => {
expect(spyB).toBeCalledWith(bEvent);
});

it('event bus fireAndAwait能够正常执行', async () => {
it('event bus fireAndAwait should be work', async () => {
const eventBus = new EventBusImpl();
const spyA = jest.fn();
eventBus.on(AEvent, spyA);
Expand All @@ -50,7 +50,7 @@ describe('event-bus', () => {
expect(res[2].result).toBeUndefined;
});

it('event bus 能够多次触发', () => {
it('event bus can be triggered multiple times', () => {
const eventBus = new EventBusImpl();
const spy = jest.fn();
eventBus.on(AEvent, spy);
Expand All @@ -71,13 +71,13 @@ describe('event-bus', () => {
expect(spy).toBeCalledWith(b1);
});

it('没有注册监听函数的时候,fire 不会报错', () => {
it('fire will not report an error when no listener function is registered', () => {
const eventBus = new EventBusImpl();
const a1 = new AEvent(1);
eventBus.fire(a1);
});

it('使用 Decorator 去监听事件变化', () => {
it('use Decorator to listen for event changes', () => {
const spy = jest.fn();
class ResizeEvent extends BasicEvent<number> {}
const resizeEvent = new ResizeEvent(1);
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('event-bus', () => {
expect(spy).toBeCalledWith(resizeEvent);
});

it('event bus once 只能触发一次', () => {
it('event bus once can only be triggered once', () => {
const eventBus = new EventBusImpl();
const spy = jest.fn();
eventBus.once(AEvent, spy);
Expand Down
2 changes: 1 addition & 1 deletion packages/core-common/__tests__/hash-calculate.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injectable, Injector } from '@opensumi/di';
import { Injector } from '@opensumi/di';

import { IHashCalculateService, HashCalculateServiceImpl } from '../src/hash-calculate/hash-calculate';

Expand Down
108 changes: 0 additions & 108 deletions packages/core-common/__tests__/utils/arrays.test.ts

This file was deleted.

43 changes: 0 additions & 43 deletions packages/core-common/__tests__/utils/paths.test.ts

This file was deleted.

Loading

0 comments on commit cd8d025

Please sign in to comment.