Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Apr 6, 2023
1 parent d4c8b9a commit d357974
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -96,6 +96,8 @@ suite('ModelSemanticColoring', () => {
}));

const textModel = disposables.add(modelService.createModel('Hello world', languageService.createById('testMode')));
// pretend the text model is attached to an editor (so that semantic tokens are computed)
textModel.onBeforeAttached();

// wait for the provider to be called
await inFirstCall.wait();
Expand Down Expand Up @@ -151,6 +153,8 @@ suite('ModelSemanticColoring', () => {
}));

const textModel = disposables.add(modelService.createModel('', languageService.createById('testMode')));
// pretend the text model is attached to an editor (so that semantic tokens are computed)
textModel.onBeforeAttached();

// wait for the semantic tokens to be fetched
await Event.toPromise(textModel.onDidChangeTokens);
Expand Down Expand Up @@ -192,7 +196,9 @@ suite('ModelSemanticColoring', () => {
}
}));

disposables.add(modelService.createModel('', languageService.createById('testMode')));
const textModel = disposables.add(modelService.createModel('', languageService.createById('testMode')));
// pretend the text model is attached to an editor (so that semantic tokens are computed)
textModel.onBeforeAttached();

await timeout(5000);
assert.deepStrictEqual(requestCount, 2);
Expand Down

0 comments on commit d357974

Please sign in to comment.