This repository was archived by the owner on May 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -463,7 +463,7 @@ export class JWEditor {
463
463
* Stop this editor instance.
464
464
*/
465
465
async stop ( ) : Promise < void > {
466
- this . nextEventMutex ( async execCommand => {
466
+ await this . nextEventMutex ( async execCommand => {
467
467
if ( this . memory ) {
468
468
this . memory . create ( 'stop' ) ;
469
469
this . memory . switchTo ( 'stop' ) ; // Unfreeze the memory.
Original file line number Diff line number Diff line change @@ -122,7 +122,12 @@ describe('DomLayout', () => {
122
122
hasError = true ;
123
123
expect ( error . message ) . to . include ( 'default' ) ;
124
124
} ) ;
125
- await editor . stop ( ) ;
125
+ expect ( hasError ) . to . equal ( true ) ;
126
+ hasError = false ;
127
+ await editor . stop ( ) . catch ( error => {
128
+ hasError = true ;
129
+ expect ( error . message ) . to . include ( 'default' ) ;
130
+ } ) ;
126
131
expect ( hasError ) . to . equal ( true ) ;
127
132
} ) ;
128
133
} ) ;
@@ -149,7 +154,12 @@ describe('DomLayout', () => {
149
154
hasError = true ;
150
155
expect ( error . message ) . to . include ( 'default' ) ;
151
156
} ) ;
152
- await editor . stop ( ) ;
157
+ expect ( hasError ) . to . equal ( true ) ;
158
+ hasError = false ;
159
+ await editor . stop ( ) . catch ( error => {
160
+ hasError = true ;
161
+ expect ( error . message ) . to . include ( 'default' ) ;
162
+ } ) ;
153
163
expect ( hasError ) . to . equal ( true ) ;
154
164
} ) ;
155
165
it ( 'should replace the target by the template (template as string)' , async ( ) => {
You can’t perform that action at this time.
0 commit comments