Skip to content

Commit 319d8ce

Browse files
norascheuchelenatanasoiu
authored andcommitted
Combine beforeEach
1 parent f313648 commit 319d8ce

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

extensions/ql-vscode/src/vscode-tests/no-workspace/remote-queries/remote-query-history.test.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe('Remote queries and query history manager', function() {
5858
await copyHistoryState();
5959

6060
sandbox = sinon.createSandbox();
61+
disposables = new DisposableBucket();
6162

6263
localQueriesResultsViewStub = {
6364
showResults: sandbox.stub()
@@ -81,19 +82,6 @@ describe('Remote queries and query history manager', function() {
8182
onVariantAnalysisStatusUpdated: sandbox.stub(),
8283
onVariantAnalysisRemoved: sandbox.stub()
8384
} as any as VariantAnalysisManager;
84-
});
85-
86-
afterEach(function() {
87-
// set a higher timeout since recursive delete below may take a while, expecially on Windows.
88-
this.timeout(120000);
89-
deleteHistoryState();
90-
disposables.dispose(testDisposeHandler);
91-
sandbox.restore();
92-
});
93-
94-
beforeEach(() => {
95-
sandbox = sinon.createSandbox();
96-
disposables = new DisposableBucket();
9785

9886
rawQueryHistory = fs.readJSONSync(path.join(STORAGE_DIR, 'workspace-query-history.json')).queries;
9987
remoteQueryResult0 = fs.readJSONSync(path.join(STORAGE_DIR, 'queries', rawQueryHistory[0].queryId, 'query-result.json'));
@@ -123,6 +111,14 @@ describe('Remote queries and query history manager', function() {
123111
openTextDocumentSpy = sandbox.spy(workspace, 'openTextDocument');
124112
});
125113

114+
afterEach(function() {
115+
// set a higher timeout since recursive delete below may take a while, expecially on Windows.
116+
this.timeout(120000);
117+
deleteHistoryState();
118+
disposables.dispose(testDisposeHandler);
119+
sandbox.restore();
120+
});
121+
126122
it('should read query history', async () => {
127123
await qhm.readQueryHistory();
128124

0 commit comments

Comments
 (0)