Skip to content

Commit

Permalink
test: trying to make qol test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
senyai committed Jun 20, 2023
1 parent 05e23f1 commit dc962ce
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/test/suite/qualityOfLifeSuite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ async function RenderSuite(this: Suite) {
await commands.executeCommand('fossil.render', untitledDocument.uri);
sinon.assert.calledOnce(cwp);
const panel = cwp.firstCall.returnValue;
const postMessageStub = this.ctx.sandbox.stub(
panel.webview,
'postMessage'
);
const postMessageStub = this.ctx.sandbox
.stub(panel.webview, 'postMessage')
.callThrough();
const postedMessage = await new Promise<any>(c => {
postMessageStub.callsFake((message: any): Thenable<boolean> => {
const ret = postMessageStub.wrappedMethod(message);
c(message);
return ret;
});
postMessageStub
.onFirstCall()
.callsFake((message: any): Thenable<boolean> => {
const ret = postMessageStub.wrappedMethod(message);
c(message);
return ret;
});
});
sinon.assert.match(postedMessage, {
html: sinon.match.string,
Expand Down

0 comments on commit dc962ce

Please sign in to comment.