@@ -32,7 +32,6 @@ import { expect } from 'chai';
3232import * as fs from 'fs/promises' ;
3333import { Suite } from 'mocha' ;
3434import * as path from 'path/posix' ;
35- import { fail } from 'assert' ;
3635
3736function parameterizedDescribe ( body : ( this : Suite , errorRecovery : boolean ) => void ) {
3837 describe ( 'DSL' , function ( ) { body . apply ( this , [ false ] ) ; } ) ;
@@ -104,9 +103,28 @@ parameterizedDescribe(function (errorRecovery: boolean) {
104103 await protectedFiles . restore ( ) ;
105104 } ) ;
106105
107- it . only ( "has highlighting and parse errors" , async function ( ) {
108- fail ( "Artificial failure" ) ;
109- } ) ;
106+ it ( "has highlighting and parse errors" , async function ( ) {
107+ await ignoreFails ( new Workbench ( ) . getEditorView ( ) . closeAllEditors ( ) ) ;
108+ const editor = await ide . openModule ( TestWorkspace . picoFile ) ;
109+ const isPicoLoading = ide . statusContains ( "Pico" ) ;
110+ // we might miss this event, but we wait for it to show up
111+ await ignoreFails ( driver . wait ( isPicoLoading , Delays . normal , "Pico parser generator should have started" ) ) ;
112+ // now wait for the Pico parser generator to disappear
113+ await driver . wait ( async ( ) => ! ( await isPicoLoading ( ) ) , Delays . verySlow , "Pico parser generator should have finished" , 100 ) ;
114+ await ide . hasSyntaxHighlighting ( editor , Delays . slow ) ;
115+ console . log ( "We got syntax highlighting" ) ;
116+ try {
117+ await editor . setTextAtLine ( 10 , "b := ;" ) ;
118+ await ide . hasErrorSquiggly ( editor , Delays . slow ) ;
119+ } catch ( e ) {
120+ console . log ( `Failed to trigger parse error: ${ e } ` ) ;
121+ if ( e instanceof Error ) {
122+ console . log ( e . stack ) ;
123+ }
124+ } finally {
125+ await ide . revertOpenChanges ( ) ;
126+ }
127+ } ) . retries ( 2 ) ;
110128
111129 it ( "has highlighting and parse errors for second extension" , async function ( ) {
112130 const editor = await ide . openModule ( TestWorkspace . picoNewFile ) ;
0 commit comments