@@ -98,37 +98,46 @@ exports.Test = require('./test');
98
98
99
99
let currentContext ;
100
100
exports . afterEach = function ( ...args ) {
101
- ( currentContext . afterEach || currentContext . teardown ) . apply ( this , args ) ;
101
+ return ( currentContext . afterEach || currentContext . teardown ) . apply (
102
+ this ,
103
+ args
104
+ ) ;
102
105
} ;
103
106
exports . after = function ( ...args ) {
104
- ( currentContext . after || currentContext . suiteTeardown ) . apply ( this , args ) ;
107
+ return ( currentContext . after || currentContext . suiteTeardown ) . apply (
108
+ this ,
109
+ args
110
+ ) ;
105
111
} ;
106
112
exports . beforeEach = function ( ...args ) {
107
- ( currentContext . beforeEach || currentContext . setup ) . apply ( this , args ) ;
113
+ return ( currentContext . beforeEach || currentContext . setup ) . apply ( this , args ) ;
108
114
} ;
109
115
exports . before = function ( ...args ) {
110
- ( currentContext . before || currentContext . suiteSetup ) . apply ( this , args ) ;
116
+ return ( currentContext . before || currentContext . suiteSetup ) . apply ( this , args ) ;
111
117
} ;
112
118
exports . describe = function ( ...args ) {
113
- ( currentContext . describe || currentContext . suite ) . apply ( this , args ) ;
119
+ return ( currentContext . describe || currentContext . suite ) . apply ( this , args ) ;
114
120
} ;
115
121
exports . describe . only = function ( ...args ) {
116
- ( currentContext . describe || currentContext . suite ) . only . apply ( this , args ) ;
122
+ return ( currentContext . describe || currentContext . suite ) . only . apply (
123
+ this ,
124
+ args
125
+ ) ;
117
126
} ;
118
127
exports . describe . skip = function ( ...args ) {
119
- ( currentContext . describe || currentContext . suite ) . skip . apply ( this , args ) ;
128
+ return ( currentContext . describe || currentContext . suite ) . skip . apply (
129
+ this ,
130
+ args
131
+ ) ;
120
132
} ;
121
133
exports . it = function ( ...args ) {
122
- ( currentContext . it || currentContext . test ) . apply ( this , args ) ;
134
+ return ( currentContext . it || currentContext . test ) . apply ( this , args ) ;
123
135
} ;
124
136
exports . it . only = function ( ...args ) {
125
- ( currentContext . it || currentContext . test ) . only . apply ( this , args ) ;
137
+ return ( currentContext . it || currentContext . test ) . only . apply ( this , args ) ;
126
138
} ;
127
139
exports . it . skip = function ( ...args ) {
128
- (
129
- currentContext . xit ||
130
- ( currentContext . test && currentContext . test . skip )
131
- ) . apply ( this , args ) ;
140
+ return ( currentContext . it || currentContext . test ) . skip . apply ( this , args ) ;
132
141
} ;
133
142
exports . xdescribe = exports . describe . skip ;
134
143
exports . xit = exports . it . skip ;
@@ -139,7 +148,7 @@ exports.suite = exports.describe;
139
148
exports . teardown = exports . afterEach ;
140
149
exports . test = exports . it ;
141
150
exports . run = function ( ...args ) {
142
- currentContext . run . apply ( this , args ) ;
151
+ return currentContext . run . apply ( this , args ) ;
143
152
} ;
144
153
145
154
/**
0 commit comments