captureStdout
83 }
84}
85
86async function captureStdout(fn: any) {87 let w = process.stdout.write,
88 buffer = "";
89 process.stdout.write = (s) => {
run
24 };
25}
26
27export async function run(): Promise<void> {28 const testsRoot = path.resolve(__dirname, "..");
29
30 // Setup coverage pre-test, including post-test hook to report
main
2
3import { runTests } from 'vscode-test';
4
5async function main() { 6 try {
7 // The folder containing the Extension Manifest package.json
8 // Passed to `--extensionDevelopmentPath`
sendCommand
396 return await sendData(getHost(), getPort(), JSON.stringify(composeMessage(editor)));
397}
398
399export function sendCommand(command: string): Promise<{400 message: string;
401 error: boolean;
402 errorMessage: string;
random
313 * @returns - data object
314 */
315export function prepareDebugMsg(): { text: string; file: string } {
316 const random = () => Math.round(Math.random() * 10);317 const r1 = random();
318 const r2 = random();
319
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
function sum(a, b) {
return a + b;
}
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}