Skip to content

Commit

Permalink
fix jasmine2 after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Mar 6, 2019
1 parent 799c85c commit 0c8038e
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions packages/jest-jasmine2/src/jasmine/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* eslint-disable sort-keys */

import {AssertionError} from 'assert';
import chalk from 'chalk';
import {formatExecError} from 'jest-message-util';
import {ErrorWithStack, isPromise} from 'jest-util';
import queueRunner, {
Options as QueueRunnerOptions,
Expand Down Expand Up @@ -424,14 +426,30 @@ export default function(j$: Jasmine) {

// TODO throw in Jest 25: declarationError = new Error
if (isPromise(describeReturnValue)) {
console.warn(
'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.',
console.log(
formatExecError(
new Error(
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.',
),
),
{rootDir: '', testMatch: []},
{noStackTrace: false},
),
);
} else if (describeReturnValue !== undefined) {
console.warn(
'A "describe" callback must not return a value.\n' +
'Returning a value from "describe" will fail the test in a future version of Jest.',
console.log(
formatExecError(
new Error(
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.',
),
),
{rootDir: '', testMatch: []},
{noStackTrace: false},
),
);
}

Expand Down

0 comments on commit 0c8038e

Please sign in to comment.