Migrate to jest (#7455)

This commit is contained in:
Daniel Tschinder
2018-03-03 10:58:19 +01:00
committed by GitHub
parent 53208d6998
commit 3e95830646
29 changed files with 1861 additions and 1133 deletions

View File

@@ -180,15 +180,17 @@ export default function(
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const deprecationError = new Error(
"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.",
);
deprecationError.name = "DeprecationWarning";
const message =
"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWarning(deprecationError);
// A string is directly supplied to emitWarning, because when supplying an
// Error object node throws in the tests because of different contexts
process.emitWarning(message, "DeprecationWarning");
} else {
console.warn(deprecationError);
const deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
}