Skip to content

Commit

Permalink
Extract messages to common
Browse files Browse the repository at this point in the history
  • Loading branch information
CompuIves committed May 31, 2019
1 parent 01ccbab commit a376cc2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import TestDetailsContent from './TestDetails';
import TestSummary from './TestSummary';
import TestOverview from './TestOverview';
import { DevToolProps } from '..';
import { messages } from './../../../../../../src/sandbox/eval/tests/jest-lite';
import { messages } from '@codesandbox/common/lib/utils/jest-lite';

export type IMessage = {
type: 'message' | 'command' | 'return';
Expand Down
16 changes: 2 additions & 14 deletions packages/app/src/sandbox/eval/tests/jest-lite.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { dispatch, actions, listen } from 'codesandbox-api';
import { react, reactTs } from '@codesandbox/common/lib/templates';
import { messages } from '@codesandbox/common/lib/utils/jest-lite';

import expect from 'jest-matchers';
import jestMock from 'jest-mock';
import jestTestHooks from 'jest-circus';
Expand Down Expand Up @@ -87,20 +89,6 @@ function resetTestState() {
setState(INITIAL_STATE);
}

export enum messages {
INITIALIZE = 'initialize_tests',
ADD_FILE = 'add_file',
REMOVE_FILE = 'remove_file',
FILE_ERROR = 'file_error',
TOTAL_TEST_START = 'total_test_start',
TOTAL_TEST_END = 'total_test_end',
TEST_START = 'test_start',
TEST_END = 'test_end',
DESCRIBE_START = 'describe_start',
DESCRIBE_END = 'describe_end',
ADD_TEST = 'add_test',
}

export default class TestRunner {
tests: Array<Module>;
ranTests: Set<string>;
Expand Down
13 changes: 13 additions & 0 deletions packages/common/src/utils/jest-lite.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export enum messages {
INITIALIZE = 'initialize_tests',
ADD_FILE = 'add_file',
REMOVE_FILE = 'remove_file',
FILE_ERROR = 'file_error',
TOTAL_TEST_START = 'total_test_start',
TOTAL_TEST_END = 'total_test_end',
TEST_START = 'test_start',
TEST_END = 'test_end',
DESCRIBE_START = 'describe_start',
DESCRIBE_END = 'describe_end',
ADD_TEST = 'add_test',
}

0 comments on commit a376cc2

Please sign in to comment.