File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,14 @@ const _runTestsForDescribeBlock = async (
82
82
83
83
const _runTest = async ( test : Circus . TestEntry ) : Promise < void > => {
84
84
await dispatch ( { name : 'test_start' , test} ) ;
85
- const testContext = Object . create ( null ) ;
85
+
86
+ const testContext : Circus . TestContext = { } ;
87
+ testContext . asyncSkipped = false ;
88
+ testContext . skip = async ( ) => {
89
+ testContext . asyncSkipped = true ;
90
+ await dispatch ( { name : 'test_skip' , test} ) ;
91
+ } ;
92
+
86
93
const { hasFocusedTests, testNamePattern} = getState ( ) ;
87
94
88
95
const isSkipped =
@@ -120,7 +127,9 @@ const _runTest = async (test: Circus.TestEntry): Promise<void> => {
120
127
// `afterAll` hooks should not affect test status (pass or fail), because if
121
128
// we had a global `afterAll` hook it would block all existing tests until
122
129
// this hook is executed. So we dispatch `test_done` right away.
123
- await dispatch ( { name : 'test_done' , test} ) ;
130
+ if ( ! testContext . asyncSkipped ) {
131
+ await dispatch ( { name : 'test_done' , test} ) ;
132
+ }
124
133
} ;
125
134
126
135
const _callCircusHook = async ( {
You can’t perform that action at this time.
0 commit comments