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 {
463463 * Stop this editor instance.
464464 */
465465 async stop ( ) : Promise < void > {
466- this . nextEventMutex ( async execCommand => {
466+ await this . nextEventMutex ( async execCommand => {
467467 if ( this . memory ) {
468468 this . memory . create ( 'stop' ) ;
469469 this . memory . switchTo ( 'stop' ) ; // Unfreeze the memory.
Original file line number Diff line number Diff line change @@ -122,7 +122,12 @@ describe('DomLayout', () => {
122122 hasError = true ;
123123 expect ( error . message ) . to . include ( 'default' ) ;
124124 } ) ;
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+ } ) ;
126131 expect ( hasError ) . to . equal ( true ) ;
127132 } ) ;
128133 } ) ;
@@ -149,7 +154,12 @@ describe('DomLayout', () => {
149154 hasError = true ;
150155 expect ( error . message ) . to . include ( 'default' ) ;
151156 } ) ;
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+ } ) ;
153163 expect ( hasError ) . to . equal ( true ) ;
154164 } ) ;
155165 it ( 'should replace the target by the template (template as string)' , async ( ) => {
You can’t perform that action at this time.
0 commit comments