Skip to content

Commit

Permalink
Clean config after tests
Browse files Browse the repository at this point in the history
Clean config after tests
  • Loading branch information
RamiBerm authored Nov 21, 2021
2 parents e5abd4c + 06bc4d7 commit f14fd77
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tests/integration/runInUP9.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ suite('Run In UP9 Command', () => {
const clientSecret = process.env.UP9_CLIENT_SECRET;
const defaultWorkspace = process.env.DEFAULT_WORKSPACE;

// initialize extension config
const up9ConfigSection = vscode.workspace.getConfiguration(up9ConfigSectionName);
await up9ConfigSection.update(envConfigKey, up9Env, vscode.ConfigurationTarget.Global);
await up9ConfigSection.update(clientIdConfigKey, clientId, vscode.ConfigurationTarget.Global);
Expand All @@ -39,8 +40,13 @@ suite('Run In UP9 Command', () => {
extensionContext = await extension.activate();
});

after(() => {
vscode.window.showInformationMessage('All tests done!');
after(async () => {
// reset extension config
const up9ConfigSection = vscode.workspace.getConfiguration(up9ConfigSectionName);
await up9ConfigSection.update(envConfigKey, "", vscode.ConfigurationTarget.Global);
await up9ConfigSection.update(clientIdConfigKey, "", vscode.ConfigurationTarget.Global);
await up9ConfigSection.update(clientSecretConfigKey, "", vscode.ConfigurationTarget.Global);
await up9ConfigSection.update(defaultWorkspaceConfigKey, "", vscode.ConfigurationTarget.Global);
});

test('Run passing tests', async function() {
Expand Down

0 comments on commit f14fd77

Please sign in to comment.