Skip to content

Commit

Permalink
tests tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
DumpySquare committed Nov 4, 2022
1 parent be0050d commit 187622c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
9 changes: 5 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,11 +910,12 @@ export async function activateInternal(context: ExtensionContext) {
});


if (resp) {
return ext.panel.render(resp);
}
}


if (resp) {
return ext.panel.render(resp);
}

}));


Expand Down
27 changes: 6 additions & 21 deletions src/test/suite/rawAPI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,11 @@ suite('external raw HTTP API tests', () => {
* execute command to start function
* should make the api call, then open a new editor with response
*/
await commands.executeCommand('f5.makeRequest');
const newEditor = await commands.executeCommand('f5.makeRequest') as TextDocument;

await new Promise(r => setTimeout(r, 1000)); // let the command finish

const editor = window.activeTextEditor; // get active editor
let text = '';
if(editor){
// get all text from editor
text = editor.document.getText();
}
const text = newEditor.getText();

assert.deepStrictEqual(JSON.parse(text), recvString);
}).timeout(10000);
Expand Down Expand Up @@ -101,16 +96,11 @@ suite('external raw HTTP API tests', () => {
* execute command to start function
* should make the api call, then open a new editor with response
*/
await commands.executeCommand('f5.makeRequest');
const newEditor = await commands.executeCommand('f5.makeRequest') as TextDocument;

await new Promise(r => setTimeout(r, 1000)); // let the command finish

const editor = window.activeTextEditor; // get active editor
let text = '';
if(editor){
// get all text from editor
text = editor.document.getText();
}
const text = newEditor.getText();

assert.deepStrictEqual(JSON.parse(text), recvString);
}).timeout(10000);
Expand Down Expand Up @@ -166,16 +156,11 @@ suite('external raw HTTP API tests', () => {
* execute command to start function
* should make the api call, then open a new editor with response
*/
await commands.executeCommand('f5.makeRequest');
const newEditor = await commands.executeCommand('f5.makeRequest') as TextDocument;

await new Promise(r => setTimeout(r, 100)); // let the command finish

const editor = window.activeTextEditor; // get active editor
let text = '';
if(editor){
// get all text from editor
text = editor.document.getText();
}
const text = newEditor.getText();

assert.deepStrictEqual(JSON.parse(text), recvString);
}).timeout(10000);
Expand Down

0 comments on commit 187622c

Please sign in to comment.