This repository was archived by the owner on Jul 29, 2024. It is now read-only.
File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,8 @@ exports.run = function(runner, specs) {
27
27
global . before = mochaAdapters . before ;
28
28
global . beforeEach = mochaAdapters . beforeEach ;
29
29
30
- // The implementation of mocha's it.only uses global.it, so since that has
31
- // already been wrapped we must avoid wrapping it a second time.
32
- // See Mocha.prototype.loadFiles and bdd's context.it.only for more details.
33
- var originalOnly = global . it . only ;
34
30
global . it = mochaAdapters . it ;
35
- global . it . only = global . iit = originalOnly ;
36
-
31
+ global . it . only = global . iit = mochaAdapters . iit ;
37
32
global . it . skip = global . xit = mochaAdapters . xit ;
38
33
} catch ( err ) {
39
34
deferred . reject ( err ) ;
Original file line number Diff line number Diff line change @@ -34,4 +34,16 @@ describe('protractor library', function() {
34
34
browser . get ( 'index.html' ) ;
35
35
expect ( browser . getTitle ( ) ) . to . eventually . equal ( 'My AngularJS App' ) ;
36
36
} ) ;
37
+
38
+ describe ( 'with async tests' , function ( ) {
39
+ var finished = false ;
40
+
41
+ it ( 'should wait for async operations to finish' , function ( ) {
42
+ browser . get ( 'index.html' ) . then ( ( ) => { finished = true } ) ;
43
+ } ) ;
44
+
45
+ after ( 'verify mocha waited' , function ( ) {
46
+ if ( ! finished ) { throw new Error ( 'Mocha did not wait for async!' ) ; }
47
+ } ) ;
48
+ } ) ;
37
49
} ) ;
You can’t perform that action at this time.
0 commit comments