Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS migration jest-circus #7916

Merged
merged 44 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1850348
Migration to ts (part 1)
doniyor2109 Feb 16, 2019
3309c3b
Merge remote-tracking branch 'jest/master' into jest-circus/ts_migration
doniyor2109 Feb 16, 2019
e89b57b
Migration to ts (part 2)
doniyor2109 Feb 16, 2019
62d423c
Migration to ts (part 3)
doniyor2109 Feb 16, 2019
6d18743
Minor tweaks
doniyor2109 Feb 16, 2019
f8d6b1c
TS migration (part 4)
doniyor2109 Feb 16, 2019
a279271
Wrong dts
doniyor2109 Feb 16, 2019
d0adc8e
dts for co
doniyor2109 Feb 16, 2019
bd16585
Added project references
doniyor2109 Feb 16, 2019
017df40
Merge remote-tracking branch 'jest/master' into jest-circus/ts_migration
doniyor2109 Feb 16, 2019
2ad24c1
Remove not ts module
doniyor2109 Feb 16, 2019
b033e2e
Replace custom co dts with @types/co
doniyor2109 Feb 17, 2019
f75fa0a
No index file
SimenB Feb 17, 2019
0fad01d
Some tweaks
doniyor2109 Feb 17, 2019
e982e1e
Some tweaks
doniyor2109 Feb 17, 2019
2d82778
Temp DiffOptions type
doniyor2109 Feb 17, 2019
c76f342
Remove extra eslint disable
doniyor2109 Feb 17, 2019
6401264
Workaround for global vars
doniyor2109 Feb 17, 2019
6e11c8d
Resolves
doniyor2109 Feb 17, 2019
dd6cc0f
Move @types/co to devDeps
doniyor2109 Feb 17, 2019
ecdc291
Update packages/jest-circus/src/run.ts
SimenB Feb 17, 2019
54a986e
Update packages/jest-circus/src/utils.ts
SimenB Feb 17, 2019
0cc1688
Tweaks
doniyor2109 Feb 17, 2019
aecf7e1
Remove extra types
doniyor2109 Feb 17, 2019
ffa6116
Fix failing test
doniyor2109 Feb 18, 2019
8a8b967
Merge remote-tracking branch 'jest/master' into jest-circus/ts_migration
doniyor2109 Feb 21, 2019
ec797a0
TS migration part (4)
doniyor2109 Feb 21, 2019
2638e24
Fix linter errors
doniyor2109 Feb 21, 2019
41e8e8d
Fix types for tests
doniyor2109 Feb 21, 2019
6df3fd4
Fix @jest/types cannot be found in test
doniyor2109 Feb 22, 2019
bb16143
Detailed comment for flowfix
doniyor2109 Feb 22, 2019
9e8545b
Ignore ts errors for non migrated modules
doniyor2109 Feb 22, 2019
aa322f8
`import =` is not supported by @babel/plugin-transform-typescript
doniyor2109 Feb 22, 2019
a0766a6
Fix weired ts error
doniyor2109 Feb 22, 2019
1f88dd6
Fix linter errors
doniyor2109 Feb 22, 2019
de7b093
Remove extra eslint disables
doniyor2109 Feb 22, 2019
ec2bcda
Move expect types to @jest/types
doniyor2109 Feb 22, 2019
0ed2e9e
[email protected]:doniyor2109/jest.giterge branch 'master' into jest-ci…
SimenB Feb 22, 2019
136f986
tweaks
SimenB Feb 22, 2019
fbe9d77
remove jest config change
SimenB Feb 22, 2019
5b49c03
fix test
SimenB Feb 22, 2019
88655bb
Added reminder for replacing Each type
doniyor2109 Feb 22, 2019
849b8c2
keep comments from old tests
SimenB Feb 22, 2019
cba5c77
Update CHANGELOG.md
SimenB Feb 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Some tweaks
  • Loading branch information
doniyor2109 committed Feb 17, 2019
commit 0fad01d9319c0fe2a053393f606428bcc4be4a07
2 changes: 1 addition & 1 deletion packages/jest-circus/src/__mocks__/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {sync as spawnSync, ExecaReturns} from 'execa';
// @ts-ignore
import {skipSuiteOnWindows} from '../../../../scripts/ConditionalTest';

const CIRCUS_PATH = require.resolve('../../build/index');
const CIRCUS_PATH = require.resolve('../../build');
const CIRCUS_RUN_PATH = require.resolve('../../build/run');
const CIRCUS_STATE_PATH = require.resolve('../../build/state');
const TEST_EVENT_HANDLER_PATH = require.resolve('./testEventHandler');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let circusIt;
// the two with this alias.

const aliasCircusIt = () => {
const {it} = require('../index.ts');
const {it} = require('../');
circusIt = it;
};

Expand Down
6 changes: 3 additions & 3 deletions packages/jest-circus/src/eventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const eventHandler: EventHandler = (event, state): void => {
// i'm not sure if this is works. For now i just replicated whatever
// jasmine was doing -- dabramov
state.parentProcess = event.parentProcess;
invariant(state.parentProcess, '');
invariant(state.parentProcess);
state.originalGlobalErrorHandlers = injectGlobalErrorHandlers(
state.parentProcess,
);
Expand All @@ -177,8 +177,8 @@ const eventHandler: EventHandler = (event, state): void => {
break;
}
case 'teardown': {
invariant(state.originalGlobalErrorHandlers, '');
invariant(state.parentProcess, '');
invariant(state.originalGlobalErrorHandlers);
invariant(state.parentProcess);
restoreGlobalErrorHandlers(
state.parentProcess!,
state.originalGlobalErrorHandlers!,
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const makeTest = (
timeout: number | null | undefined,
asyncError: Exception,
): TestEntry => {
const errors: Array<[Exception | null | undefined, Exception]> = [];
const errors: Array<[Exception | undefined, Exception]> = [];

return {
asyncError,
Expand Down Expand Up @@ -361,7 +361,7 @@ export const addErrorToEachTestUnderDescribe = (
}
};

export const invariant = (condition: unknown, message: string) => {
export const invariant = (condition: unknown, message?: string) => {
if (!condition) {
throw new Error(message);
}
Expand Down