@@ -18,22 +18,28 @@ const eventHandlers: Array<Circus.EventHandler> = [
1818
1919export const ROOT_DESCRIBE_BLOCK_NAME = 'ROOT_DESCRIBE_BLOCK' ;
2020
21- const ROOT_DESCRIBE_BLOCK = makeDescribe ( ROOT_DESCRIBE_BLOCK_NAME ) ;
22- const INITIAL_STATE : Circus . State = {
23- currentDescribeBlock : ROOT_DESCRIBE_BLOCK ,
24- currentlyRunningTest : null ,
25- expand : undefined ,
26- hasFocusedTests : false ,
27- hasStarted : false ,
28- includeTestLocationInResult : false ,
29- parentProcess : null ,
30- rootDescribeBlock : ROOT_DESCRIBE_BLOCK ,
31- testNamePattern : null ,
32- testTimeout : 5000 ,
33- unhandledErrors : [ ] ,
21+ const createState = ( ) : Circus . State => {
22+ const ROOT_DESCRIBE_BLOCK = makeDescribe ( ROOT_DESCRIBE_BLOCK_NAME ) ;
23+ return {
24+ currentDescribeBlock : ROOT_DESCRIBE_BLOCK ,
25+ currentlyRunningTest : null ,
26+ expand : undefined ,
27+ hasFocusedTests : false ,
28+ hasStarted : false ,
29+ includeTestLocationInResult : false ,
30+ parentProcess : null ,
31+ rootDescribeBlock : ROOT_DESCRIBE_BLOCK ,
32+ testNamePattern : null ,
33+ testTimeout : 5000 ,
34+ unhandledErrors : [ ] ,
35+ } ;
3436} ;
3537
36- global [ STATE_SYM ] = INITIAL_STATE ;
38+ export const resetState = ( ) : void => {
39+ global [ STATE_SYM ] = createState ( ) ;
40+ } ;
41+
42+ resetState ( ) ;
3743
3844export const getState = ( ) : Circus . State => global [ STATE_SYM ] ;
3945export const setState = ( state : Circus . State ) : Circus . State =>
0 commit comments