Lines Matching defs:const

2 const {
23 const { AsyncResource } = require('async_hooks');
24 const { basename, relative } = require('path');
25 const { createWriteStream } = require('fs');
26 const { pathToFileURL } = require('internal/url');
27 const { createDeferredPromise } = require('internal/util');
28 const { getOptionValue } = require('internal/options');
29 const { green, yellow, red, white, shouldColorize } = require('internal/util/colors');
31 const {
38 const { compose } = require('stream');
40 const coverageColors = {
47 const kMultipleCallbackInvocations = 'multipleCallbackInvocations';
48 const kRegExpPattern = /^\/(.*)\/([a-z]*)$/;
49 const kSupportedFileExtensions = /\.[cm]?js$/;
50 const kTestFilePattern = /((^test(-.+)?)|(.+[.\-_]test))\.[cm]?js$/;
62 const { promise, resolve, reject } = createDeferredPromise();
63 const cb = (err) => {
94 const match = RegExpPrototypeExec(kRegExpPattern, str);
95 const pattern = match?.[1] ?? str;
96 const flags = match?.[2] || '';
101 const msg = err?.message;
111 const kBuiltinDestinations = new SafeMap([
116 const kBuiltinReporters = new SafeMap([
123 const kDefaultReporter = process.stdout.isTTY ? 'spec' : 'tap';
124 const kDefaultDestination = 'stdout';
127 const builtinPath = kBuiltinReporters.get(name);
138 const destination = kBuiltinDestinations.get(destinations[i]) ?? createWriteStream(destinations[i]);
153 const { esmLoader } = require('internal/process/esm_loader');
173 const reporterScope = new AsyncResource('TestReporterScope');
174 const setupTestReporters = reporterScope.bind(async (rootTest) => {
175 const { reporters, destinations } = parseCommandLine();
176 const reportersMap = await getReportersMap(reporters, destinations, rootTest);
178 const { reporter, destination } = reportersMap[i];
190 const isTestRunner = getOptionValue('--test');
191 const coverage = getOptionValue('--experimental-test-coverage');
192 const isChildProcess = process.env.NODE_TEST_CONTEXT === 'child';
193 const isChildProcessV8 = process.env.NODE_TEST_CONTEXT === 'child-v8';
230 const testNamePatternFlag = getOptionValue('--test-name-pattern');
277 const memo = new SafeMap();
279 const key = `${prefix}-${width}`;
289 const kHorizontalEllipsis = '\u2026';
314 const kColumns = ['line %', 'branch %', 'funcs %'];
315 const kColumnsKeys = ['coveredLinePercent', 'coveredBranchPercent', 'coveredFunctionPercent'];
316 const kSeparator = ' | ';
319 const prefix = `${pad}${symbol}`;
332 const fileWidth = filePadLength + 2;
335 const columnsWidth = ArrayPrototypeReduce(columnPadLengths, (acc, columnPadLength) => acc + columnPadLength + 3, 0);
340 const uncoveredLinesWidth = uncoveredLinesPadLength + 2;
345 const availableWidth = (process.stdout.columns || Infinity) - prefix.length;
346 const columnsExtras = tableWidth - availableWidth;
349 const minFilePad = MathMin(8, filePadLength);
387 const file = summary.files[i];
388 const relativePath = relative(summary.workingDirectory, file.path);
391 const coverages = ArrayPrototypeMap(kColumnsKeys, (columnKey) => {
392 const percent = file[columnKey];