Skip to content

Commit

Permalink
adding missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
connectdotz committed Nov 1, 2023
1 parent 39061d2 commit 428ba65
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test-provider/test-item-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,25 @@ describe('test-item-data', () => {
expect(run.failed).toHaveBeenCalledWith(tItem, { message: a1.message });
expect(tItem.range).toEqual({ args: [1, 0, 1, 0] });
});
it('if nothing is updated, output the message', () => {
const wsRoot = new WorkspaceRoot(context);
expect(wsRoot.item.children.size).toBe(0);

const run = createTestRun();
context.ext.testResultProvider.events.testSuiteChanged.event.mock.calls[0][0]({
type: 'assertions-updated',
process: { id: 'whatever', request: { type: 'watch-tests' }, userData: { run } },
files: [],
});
// no tests items to be added
expect(wsRoot.item.children.size).toBe(0);

expect(run.write).toHaveBeenCalledWith(
expect.stringContaining('No tests'),
expect.anything()
);
expect(run.end).toHaveBeenCalled();
});
});
describe('when testSuiteChanged.result-matched event fired', () => {
it('test data range and snapshot context will be updated accordingly', () => {
Expand Down

0 comments on commit 428ba65

Please sign in to comment.