Skip to content

Commit

Permalink
Fix #50335
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed May 24, 2018
1 parent 303f715 commit 8bf066e
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/vs/workbench/parts/search/test/common/searchModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,24 @@ suite('SearchModel', () => {
assert.deepEqual(['searchResultsFirstRender', { duration: -1 }], data);
});

// test('Search Model: Search reports timed telemetry on search when progress is not called', () => {
// let target2 = sinon.spy();
// stub(nullEvent, 'stop', target2);
// let target1 = sinon.stub().returns(nullEvent);
// instantiationService.stub(ITelemetryService, 'publicLog', target1);

// instantiationService.stub(ISearchService, 'search', ppromiseWithProgress([]));
test('Search Model: Search reports timed telemetry on search when progress is not called', () => {
let target2 = sinon.spy();
stub(nullEvent, 'stop', target2);
let target1 = sinon.stub().returns(nullEvent);
instantiationService.stub(ITelemetryService, 'publicLog', target1);

// let testObject = instantiationService.createInstance(SearchModel);
// const result = testObject.search({ contentPattern: { pattern: 'somestring' }, type: 1, folderQueries });
instantiationService.stub(ISearchService, 'search', ppromiseWithProgress([]));

// return timeout(1).then(() => {
// return result.then(() => {
// assert.ok(target1.calledWith('searchResultsFirstRender'));
// assert.ok(target1.calledWith('searchResultsFinished'));
// });
let testObject = instantiationService.createInstance(SearchModel);
const result = testObject.search({ contentPattern: { pattern: 'somestring' }, type: 1, folderQueries });

// });
// });
return result.then(() => {
return timeout(1).then(() => {
assert.ok(target1.calledWith('searchResultsFirstRender'));
assert.ok(target1.calledWith('searchResultsFinished'));
});
});
});

test('Search Model: Search reports timed telemetry on search when progress is called', () => {
let target2 = sinon.spy();
Expand Down

0 comments on commit 8bf066e

Please sign in to comment.