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

fix typos #1038

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"scope": "resource"
},
"jest.nodeEnv": {
"markdownDescription": "The env passed to runner process in addtion to `process.env`",
"markdownDescription": "The env passed to runner process in addition to `process.env`",
"type": "object",
"default": null,
"scope": "resource"
Expand Down
4 changes: 2 additions & 2 deletions release-notes/release-note-v5.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
---


v5 mainly focuses on addressing performance, stablity and ease of use. The goal is to help new and experienced users fully utilize the extension features to make testing a fun experience.
v5 mainly focuses on addressing performance, stability and ease of use. The goal is to help new and experienced users fully utilize the extension features to make testing a fun experience.

We have also decided to make TestExplorer a preferred UI outlet instead of our custom UI developed before TestExplorer. For example, we no longer support the inline decorator for test status as TestExplorer provided a much more powerful gutter status/menu.
### Main Features
Expand Down Expand Up @@ -97,7 +97,7 @@ On non-windows platforms, vscode sometimes fails to initialize its process env u

The extension can auto generate login shell for `bash`, `zsh`, and `fish`. Users can also configure custom login shells by expanding the current ["jest.shell"](../README.md#shell) setting, such as: `"jest.shell": {"path:": "/bin/bash", "args": ["-l"]}`. This will instruct the extension to always use the login shell.

Please note these changes only apply to test runs; you might experience similar issues when debugging tests, as we do not control how the vscode debugger is launched. But fortunately, a similar solution (login shell) will work for debugging as well - by customizing `"terminal.integrated.automationProfile.<platform>"`; see instruction in [intermitten error troubleshooting](../README.md##intermittent-errors-for-npmyarnnode-command-not-found-during-test-run-or-debugging)
Please note these changes only apply to test runs; you might experience similar issues when debugging tests, as we do not control how the vscode debugger is launched. But fortunately, a similar solution (login shell) will work for debugging as well - by customizing `"terminal.integrated.automationProfile.<platform>"`; see instruction in [intermittent error troubleshooting](../README.md##intermittent-errors-for-npmyarnnode-command-not-found-during-test-run-or-debugging)


([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz)
Expand Down
4 changes: 2 additions & 2 deletions release-notes/release-note-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
---
## v5.0 (pre-release) (roll-up)

v5 mainly focuses on addressing performance, stablity and ease of use. The goal is to help new and experienced users fully utilize the extension features to make testing a fun experience.
v5 mainly focuses on addressing performance, stability and ease of use. The goal is to help new and experienced users fully utilize the extension features to make testing a fun experience.

We have also decided to make TestExplorer a preferred UI outlet instead of our custom UI developed before TestExplorer. For example, we no longer support the inline decorator for test status as TestExplorer provided a much more powerful gutter status/menu.
### Main Features
Expand Down Expand Up @@ -96,7 +96,7 @@ On non-windows platforms, vscode sometimes fails to initialize its process env u

The extension can auto generate login shell for `bash`, `zsh`, and `fish`. Users can also configure custom login shells by expanding the current ["jest.shell"](../README.md#shell) setting, such as: `"jest.shell": {"path:": "/bin/bash", "args": ["-l"]}`. This will instruct the extension to always use the login shell.

Please note these changes only apply to test runs; you might experience similar issues when debugging tests, as we do not control how the vscode debugger is launched. But fortunately, a similar solution (login shell) will work for debugging as well - by customizing `"terminal.integrated.automationProfile.<platform>"`; see instruction in [intermitten error troubleshooting](../README.md##intermittent-errors-for-npmyarnnode-command-not-found-during-test-run-or-debugging)
Please note these changes only apply to test runs; you might experience similar issues when debugging tests, as we do not control how the vscode debugger is launched. But fortunately, a similar solution (login shell) will work for debugging as well - by customizing `"terminal.integrated.automationProfile.<platform>"`; see instruction in [intermittent error troubleshooting](../README.md##intermittent-errors-for-npmyarnnode-command-not-found-during-test-run-or-debugging)


([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz)
Expand Down
2 changes: 1 addition & 1 deletion release-notes/release-note-v5.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ On non-windows platforms, vscode sometimes fails to initialize its process env u

The extension can auto generate login shell for `bash`, `zsh`, and `fish`. Users can also configure custom login shells by expanding the current ["jest.shell"](../README.md#shell) setting, such as: `"jest.shell": {"path:": "/bin/bash", "args": ["-l"]}`. This will instruct the extension to always use the login shell.

Please note these changes only apply to test runs; you might experience similar issues when debugging tests, as we do not control how the vscode debugger is launched. But fortunately, a similar solution (login shell) will work for debugging as well - by customizing `"terminal.integrated.automationProfile.<platform>"`; see instruction in [intermitten error troubleshooting](../README.md##intermittent-errors-for-npmyarnnode-command-not-found-during-test-run-or-debugging)
Please note these changes only apply to test runs; you might experience similar issues when debugging tests, as we do not control how the vscode debugger is launched. But fortunately, a similar solution (login shell) will work for debugging as well - by customizing `"terminal.integrated.automationProfile.<platform>"`; see instruction in [intermittent error troubleshooting](../README.md##intermittent-errors-for-npmyarnnode-command-not-found-during-test-run-or-debugging)


([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz)
Expand Down
8 changes: 4 additions & 4 deletions src/Coverage/Formatters/AbstractFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export abstract class AbstractFormatter {
}

abstract format(editor: vscode.TextEditor): void;
/** remove decoractors for the given editor */
/** remove decorators for the given editor */
abstract clear(editor: vscode.TextEditor): void;
/** dispose decoractors for all editors */
/** dispose decorators for all editors */
abstract dispose(): void;

/**
Expand Down Expand Up @@ -66,14 +66,14 @@ export abstract class AbstractFormatter {
return ranges;
}
const lineCoverage = fileCoverage.getLineCoverage();
const branchCoveravge = fileCoverage.getBranchCoverageByLine();
const branchCoverage = fileCoverage.getBranchCoverageByLine();
const funcCoverage = this.getFunctionCoverageByLine(fileCoverage);

// consolidate the coverage by line
for (let line = 1; line <= editor.document.lineCount; line++) {
const zeroBasedLineNumber = line - 1;
const lc = lineCoverage[line];
const bc = branchCoveravge[line];
const bc = branchCoverage[line];
const fc = funcCoverage[line];
const statusList: CoverageStatus[] = [];
if (fc != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/DebugConfigurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class DebugConfigurationProvider implements vscode.DebugConfigurationProv
}

/**
* generate a debug config incorperating commandLine and rootPath. Throw exception if error.
* generate a debug config incorporating commandLine and rootPath. Throw exception if error.
* @param cmdLine
* @param rootPath
* @returns a debug config.
Expand Down
10 changes: 5 additions & 5 deletions src/JestExt/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class JestExt {

private workspaceManager: WorkspaceManager;
private output: JestOutputTerminal;
private deubgConfig?: vscode.DebugConfiguration;
private debugConfig?: vscode.DebugConfiguration;

constructor(
vscodeContext: vscode.ExtensionContext,
Expand Down Expand Up @@ -437,7 +437,7 @@ export class JestExt {
);

this.extContext = createJestExtContext(this.extContext.workspace, updatedSettings, this.output);
this.deubgConfig = undefined;
this.debugConfig = undefined;

await this.startSession(true);
}
Expand Down Expand Up @@ -633,7 +633,7 @@ export class JestExt {
);

let debugConfig =
getDebugConfig(this.extContext.workspace) ?? getDebugConfig() ?? this.deubgConfig;
getDebugConfig(this.extContext.workspace) ?? getDebugConfig() ?? this.debugConfig;

if (!debugConfig) {
this.logging(
Expand All @@ -652,7 +652,7 @@ export class JestExt {
)[0];
}

this.deubgConfig = debugConfig;
this.debugConfig = debugConfig;
this.extContext.output.write('auto config debug config:', 'info');
this.extContext.output.write(JSON.stringify(debugConfig, undefined, ' '), 'new-line');
}
Expand Down Expand Up @@ -770,7 +770,7 @@ export class JestExt {
return;
}

// there is a bit redudant since didSave already handle the save changes
// there is a bit redundant since didSave already handle the save changes
// but not sure if there are other non-editor related change we are trying
// to capture, so leave it be for now...
this.refreshDocumentChange(event.document);
Expand Down
2 changes: 1 addition & 1 deletion src/JestExt/helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* collection of stateless utility functions for declutter and easy to test
* collection of stateless utility functions for de-clutter and easy to test
*/
import * as vscode from 'vscode';
import { ProjectWorkspace, LoginShell, JESParserPluginOptions } from 'jest-editor-support';
Expand Down
6 changes: 3 additions & 3 deletions src/JestExt/output-terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class PendingOutput {
}
}

/** termerinal per workspace */
/** terminal per workspace */
export class ExtOutputTerminal implements JestExtOutput {
private pendingMessages: PendingOutput;
private ptyIsOpen: boolean;
Expand All @@ -63,10 +63,10 @@ export class ExtOutputTerminal implements JestExtOutput {
this._terminal = undefined;
},
};
constructor(private name: string, visibile?: boolean) {
constructor(private name: string, visible?: boolean) {
this.ptyIsOpen = false;
this.pendingMessages = new PendingOutput();
this.canReveal = visibile ?? false;
this.canReveal = visible ?? false;
this.revealOnError = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/JestExt/process-listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class LongRunMonitor {
return;
}
if (this.timer) {
this.logging('warn', `LongRunMonitor is already runninng`);
this.logging('warn', `LongRunMonitor is already running`);
this.cancel();
}
this.timer = setTimeout(() => {
Expand Down
20 changes: 10 additions & 10 deletions src/JestExt/process-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,33 @@ const getTransform = (request: JestExtRequestType): JestProcessRequestTransform

const ProcessScheduleStrategy: Record<JestTestProcessType, ScheduleStrategy> = {
// abort if there is already an pending request
'all-tests': { queue: 'blocking', dedup: { filterByStatus: ['pending'] } },
'watch-tests': { queue: 'blocking', dedup: { filterByStatus: ['pending'] } },
'all-tests': { queue: 'blocking', dedupe: { filterByStatus: ['pending'] } },
'watch-tests': { queue: 'blocking', dedupe: { filterByStatus: ['pending'] } },
'watch-all-tests': {
queue: 'blocking',
dedup: { filterByStatus: ['pending'] },
dedupe: { filterByStatus: ['pending'] },
},

// abort if there is already identical pending request
'by-file': {
queue: 'blocking-2',
dedup: { filterByStatus: ['pending'] },
dedupe: { filterByStatus: ['pending'] },
},
'by-file-test': {
queue: 'blocking-2',
dedup: { filterByStatus: ['pending'], filterByContent: true },
dedupe: { filterByStatus: ['pending'], filterByContent: true },
},
'by-file-pattern': {
queue: 'blocking-2',
dedup: { filterByStatus: ['pending'] },
dedupe: { filterByStatus: ['pending'] },
},
'by-file-test-pattern': {
queue: 'blocking-2',
dedup: { filterByStatus: ['pending'], filterByContent: true },
dedupe: { filterByStatus: ['pending'], filterByContent: true },
},
'not-test': {
queue: 'non-blocking',
dedup: { filterByStatus: ['pending'] },
dedupe: { filterByStatus: ['pending'] },
},
};

Expand All @@ -85,7 +85,7 @@ export const createProcessSession = (context: JestExtProcessContext): ProcessSes
/**
*
* @param type
* @param stoppRunning if true, will stop and remove processes with the same type, default is false
* @param stopRunning if true, will stop and remove processes with the same type, default is false
*/
const scheduleProcess = <T extends JestExtRequestType = JestExtRequestType>(
request: T
Expand Down Expand Up @@ -157,7 +157,7 @@ export const createProcessSession = (context: JestExtProcessContext): ProcessSes
*/
const start = async (): Promise<void> => {
if (jestProcessManager.numberOfProcesses() > 0) {
logging('debug', `${jestProcessManager.numberOfProcesses} queued, stoping all...`);
logging('debug', `${jestProcessManager.numberOfProcesses} queued, stopping all...`);
await stop();
}

Expand Down
8 changes: 4 additions & 4 deletions src/JestProcessManagement/JestProcessManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { JestProcess } from './JestProcess';
import { TaskArrayFunctions, JestProcessRequest, QueueType, Task, JestProcessInfo } from './types';
import { Logging } from '../logging';
import { createTaskQueue, TaskQueue } from './task-queue';
import { isDup, requestString } from './helper';
import { isDupe, requestString } from './helper';
import { JestExtContext } from '../JestExt';

export class JestProcessManager implements TaskArrayFunctions<JestProcess> {
Expand All @@ -26,11 +26,11 @@ export class JestProcessManager implements TaskArrayFunctions<JestProcess> {
}

private foundDup(request: JestProcessRequest): boolean {
if (!request.schedule.dedup) {
if (!request.schedule.dedupe) {
return false;
}
const queue = this.getQueue(request.schedule.queue);
const dupTasks = queue.filter((p) => isDup(p, request));
const dupTasks = queue.filter((p) => isDupe(p, request));
if (dupTasks.length > 0) {
this.logging(
'debug',
Expand All @@ -42,7 +42,7 @@ export class JestProcessManager implements TaskArrayFunctions<JestProcess> {
return false;
}
/**
* schedule a jest process and handle duplication process if dedup is requested.
* schedule a jest process and handle duplication process if dedupe is requested.
* @param request
* @returns a jest process id if successfully scheduled, otherwise undefined
*/
Expand Down
6 changes: 3 additions & 3 deletions src/JestProcessManagement/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ export const isRequestEqual = (r1: JestProcessRequest, r2: JestProcessRequest):
}
};

export const isDup = (task: Task<JestProcess>, request: JestProcessRequest): boolean => {
export const isDupe = (task: Task<JestProcess>, request: JestProcessRequest): boolean => {
const process = task.data;
if (!request.schedule.dedup) {
if (!request.schedule.dedupe) {
return false;
}
const predicate: TaskPredicate = request.schedule.dedup;
const predicate: TaskPredicate = request.schedule.dedupe;

if (predicate.filterByStatus && !predicate.filterByStatus.includes(task.status)) {
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/JestProcessManagement/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type JestProcessEvent = RunnerEvent | 'processStarting';
export interface JestProcessListener {
onEvent: (process: JestProcess, event: JestProcessEvent, ...args: unknown[]) => unknown;
}
export type JestProcessStatus = 'pending' | 'running' | 'stopping' | 'stoppped';
export type JestProcessStatus = 'pending' | 'running' | 'stopping' | 'stopped';
export interface JestProcessInfo {
readonly id: string;
readonly request: JestProcessRequest;
Expand All @@ -32,11 +32,11 @@ export interface TaskPredicate {
/**
* define the eligibility for process scheduling
* @param queue the type of the queue
* @param dedup a predicate to match the task in queue.
* @param dedupe a predicate to match the task in queue.
*/
export interface ScheduleStrategy {
queue: QueueType;
dedup?: TaskPredicate;
dedupe?: TaskPredicate;
}

interface JestProcessRequestCommon {
Expand Down
2 changes: 1 addition & 1 deletion src/TestResults/match-by-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const createMessaging =
(fileName: string, _verbose: boolean) =>
(info: MessagingInfo): void => {
const build = (msg: string): Parameters<typeof console.log> => [
`[test resut matching] ${info.type} : ${msg} : "${fileName}"\n`,
`[test result matching] ${info.type} : ${msg} : "${fileName}"\n`,
info,
];
switch (info.type) {
Expand Down
6 changes: 3 additions & 3 deletions src/TestResults/match-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class BaseNode {

/**
* returns true if the node is a group node, i.e. either has non-zero group member or lastProperty === 'each'.
* If the node can not know it determinstically before matching, it should return "maybe".
* If the node can not know it deterministically before matching, it should return "maybe".
*/
isGroupNode(): 'yes' | 'no' | 'maybe' {
if (this.group.length > 0 && this.attrs.isGroup !== 'no') {
Expand All @@ -177,7 +177,7 @@ export class BaseNode {

private maybeNonLiteralName(): boolean {
// a group node (such as test.each) could have a literal name that contains variable therefore could
// genrate different test names per parameter set
// generate different test names per parameter set
return this.attrs.nonLiteralName || this.isGroupNode() !== 'no';
}

Expand Down Expand Up @@ -218,7 +218,7 @@ export class BaseNode {
/**
* check if a node is structurally "valid", i.e. is the ancestorTitle, location info are populated. This does not check
* across the nodes, just the node itself.
* @returns true if no itegrity issue otherwise false and the node.history will be updated accordingly
* @returns true if no integrity issue otherwise false and the node.history will be updated accordingly
*/
checkIntegrity(): boolean {
const issues: MatchEvent[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function updateCurrentDiagnostics(
const textLine = editor.document.lineAt(line);
const name = testIdString('display', r.identifier);
return createDiagnosticWithRange(
r.shortMessage || r.terseMessage || 'unknown errorr',
r.shortMessage || r.terseMessage || 'unknown error',
textLine.range,
name
);
Expand Down
10 changes: 5 additions & 5 deletions src/extension-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ export class ExtensionManager {
);
return;
}
let targeteExt;
let targetExt;
if (extensions.length > 1) {
targeteExt = await this.selectExtensions(extensions);
targetExt = await this.selectExtensions(extensions);
} else if (extensions.length === 1) {
targeteExt = extensions;
targetExt = extensions;
}
targeteExt?.forEach((ext) => command.callback.call(thisArg, ext, editor, ...args));
targetExt?.forEach((ext) => command.callback.call(thisArg, ext, editor, ...args));
}
);
}
Expand Down Expand Up @@ -283,7 +283,7 @@ export class ExtensionManager {
): void {
const uriList = Array.isArray(uri) ? uri : [uri];
const extension = uriList.flatMap((uri) => this.getByDocUri(uri));
// dedup
// dedupe
const set = new Set(extension);
set.forEach(handler);
}
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function checkPackageTestScript(rootPath: string): string | undefined {
isCreateReactAppTestCommand(testCommand) ||
testCommand.includes('jest') ||
// for react apps, even if we don't recognize the test script pattern, still better to use the test script
// than running the binary with hard coded parameters outselves.
// than running the binary with hard coded parameters ourselves.
hasReactBinary(rootPath)
) {
const pm = getPM(rootPath) ?? 'npm';
Expand Down Expand Up @@ -355,7 +355,7 @@ export const getValidJestCommand = async (
return Promise.resolve({ validSettings: [{ rootPath: absoluteRootPath, jestCommandLine }] });
}

// see if we can get a valid command by examing the file system
// see if we can get a valid command by examining the file system
const uris = await workspaceManager.getFoldersFromFilesystem(workspace);

const validSettings: JestCommandSettings[] = [];
Expand Down
Loading