Skip to content

Commit 0c8038e

Browse files
committed
fix jasmine2 after rebase
1 parent 799c85c commit 0c8038e

File tree

1 file changed

+24
-6
lines changed
  • packages/jest-jasmine2/src/jasmine

1 file changed

+24
-6
lines changed

packages/jest-jasmine2/src/jasmine/Env.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3131
/* eslint-disable sort-keys */
3232

3333
import {AssertionError} from 'assert';
34+
import chalk from 'chalk';
35+
import {formatExecError} from 'jest-message-util';
3436
import {ErrorWithStack, isPromise} from 'jest-util';
3537
import queueRunner, {
3638
Options as QueueRunnerOptions,
@@ -424,14 +426,30 @@ export default function(j$: Jasmine) {
424426

425427
// TODO throw in Jest 25: declarationError = new Error
426428
if (isPromise(describeReturnValue)) {
427-
console.warn(
428-
'Returning a Promise from "describe" is not supported. Tests must be defined synchronously.\n' +
429-
'Returning a value from "describe" will fail the test in a future version of Jest.',
429+
console.log(
430+
formatExecError(
431+
new Error(
432+
chalk.yellow(
433+
'Returning a Promise from "describe" is not supported. Tests must be defined synchronously.\n' +
434+
'Returning a value from "describe" will fail the test in a future version of Jest.',
435+
),
436+
),
437+
{rootDir: '', testMatch: []},
438+
{noStackTrace: false},
439+
),
430440
);
431441
} else if (describeReturnValue !== undefined) {
432-
console.warn(
433-
'A "describe" callback must not return a value.\n' +
434-
'Returning a value from "describe" will fail the test in a future version of Jest.',
442+
console.log(
443+
formatExecError(
444+
new Error(
445+
chalk.yellow(
446+
'A "describe" callback must not return a value.\n' +
447+
'Returning a value from "describe" will fail the test in a future version of Jest.',
448+
),
449+
),
450+
{rootDir: '', testMatch: []},
451+
{noStackTrace: false},
452+
),
435453
);
436454
}
437455

0 commit comments

Comments
 (0)