Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supports test-results panel and refactor output settings #1087

Merged
merged 13 commits into from
Nov 2, 2023
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into test-results-tab-…
…support
  • Loading branch information
connectdotz committed Oct 25, 2023
commit 1cacfacaf69bc35303f65d93ef4fb2b9228a469a
1 change: 1 addition & 0 deletions src/test-provider/test-item-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { JestExtOutput } from '../JestExt/output-terminal';
import { tiContextManager } from './test-item-context-manager';
import { toAbsoluteRootPath } from '../helpers';
import { runModeDescription } from '../JestExt/run-mode';
import { isVirtualWorkspaceFolder } from '../virtual-workspace-folder';
import { outputManager } from '../output-manager';

interface JestRunnable {
Expand Down
31 changes: 7 additions & 24 deletions tests/test-provider/test-item-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,30 +1171,13 @@ describe('test-item-data', () => {
const listener = context.ext.sessionEvents.onRunEvent.event.mock.results[0].value;
expect(listener.dispose).toHaveBeenCalled();
});
it.each([{ type: 'scheduled' }, { type: 'start' }])(
'$type: clear when clearOutputOnRun is true',
({ type }) => {
const runMode = new RunMode({ type: 'watch', clearOutputOnRun: true });
context.ext.settings = { runMode };
const process = mockScheduleProcess(context);
env.onRunEvent({ type, process });
expect(context.output.clear).toHaveBeenCalled();
}
);
it.each([{ type: 'scheduled' }, { type: 'start' }])(
'$type: do not clear when when autoClearTerminal is false',
({ type }) => {
context.ext.settings = { autoClearTerminal: false };
const process = mockScheduleProcess(context);
env.onRunEvent({ type, process });
expect(context.output.clear).not.toHaveBeenCalled();
}
);
});
describe('handle run event to set item status and show output', () => {
let env;
beforeEach(() => {
env = setupTestEnv();
it('can adapt raw output to terminal output', () => {
// cSpell: ignore myarn
const coloredText = '[2Kyarn run v1.22.5\n';
jestRun.write(coloredText);
expect(jestRun.vscodeRun.appendOutput).toHaveBeenCalledWith(
expect.stringContaining(coloredText)
);
});
describe('optionally clear terminal on start & schedule', () => {
let env;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.