Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(
formatExecError(
new ErrorWithStack(
chalk.yellow(
'Returning a Promise from "describe" is not supported. Tests must be defined synchronously.\n' +
'Returning a value from "describe" will fail the test in a future version of Jest.',
),
describeFn,
),
{rootDir: '', testMatch: []},
{noStackTrace: false},
),
);
} else if (describeReturn !== undefined) {
console.log(
formatExecError(
new ErrorWithStack(
chalk.yellow(
'A "describe" callback must not return a value.\n' +
'Returning a value from "describe" will fail the test in a future version of Jest.',
),
describeFn,
),
{rootDir: '', testMatch: []},
{noStackTrace: false},
),
);
}
dispatch({blockName, mode, name: 'finish_describe_definition'});
};
export const buildFailureTestResult = (
testPath: string,
err: Error,
config: ProjectConfig,
globalConfig: GlobalConfig,
): TestResult => {
const failureMessage = formatExecError(err, config, globalConfig);
return {
console: null,
displayName: '',
failureMessage,
leaks: false,
numFailingTests: 0,
numPassingTests: 0,
numPendingTests: 0,
perfStats: {
end: 0,
start: 0,
},
skipped: false,
snapshot: {
added: 0,
fileDeleted: false,
export const buildFailureTestResult = (
testPath: string,
err: Error,
config: ProjectConfig,
globalConfig: GlobalConfig,
): TestResult => {
const failureMessage = formatExecError(err, config, globalConfig);
return {
console: null,
displayName: '',
failureMessage,
leaks: false,
numFailingTests: 0,
numPassingTests: 0,
numPendingTests: 0,
perfStats: {
end: 0,
start: 0,
},
skipped: false,
snapshot: {
added: 0,
fileDeleted: false,
.map(err => formatExecError(err, config, globalConfig))
.join('\n');