Updated to eslint 9
This isn't officially compatible with the oldest version of Node that Jasmine supports, but it works. If it stops working, we can always disable linting in CI builds on older Node versions.
This commit is contained in:
@@ -36,6 +36,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
|
||||
|
||||
Deprecator.prototype.log_ = function(runnable, deprecation, options) {
|
||||
if (j$.isError_(deprecation)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(deprecation);
|
||||
return;
|
||||
}
|
||||
@@ -58,6 +59,7 @@ getJasmineRequireObj().Deprecator = function(j$) {
|
||||
context += '\n' + verboseNote;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('DEPRECATION: ' + deprecation + context);
|
||||
};
|
||||
|
||||
|
||||
@@ -385,7 +385,9 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
|
||||
// If we get here, all results have been reported and there's nothing we
|
||||
// can do except log the result and hope the user sees it.
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Jasmine received a result after the suite finished:');
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(expectationResult);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
|
||||
) {
|
||||
try {
|
||||
this.emitScalar(value.toString());
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (e) {
|
||||
this.emitScalar('has-invalid-toString-method');
|
||||
}
|
||||
@@ -304,6 +305,7 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
|
||||
value.toString !== Object.prototype.toString &&
|
||||
value.toString() !== Object.prototype.toString.call(value)
|
||||
);
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (e) {
|
||||
// The custom toString() threw.
|
||||
return true;
|
||||
|
||||
@@ -22,6 +22,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
}
|
||||
|
||||
function fallbackOnMultipleDone() {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
new Error(
|
||||
"An asynchronous function called its 'done' " +
|
||||
@@ -135,6 +136,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
// Any error we catch here is probably due to a bug in Jasmine,
|
||||
// and it's not likely to end up anywhere useful if we let it
|
||||
// propagate. Log it so it can at least show up when debugging.
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,6 +252,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
||||
let value;
|
||||
try {
|
||||
value = obj[prop];
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ getJasmineRequireObj().toBeInstanceOf = function(j$) {
|
||||
try {
|
||||
expectedMatcher = new j$.Any(expected);
|
||||
pass = expectedMatcher.asymmetricMatch(actual);
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
usageError('Expected value is not a constructor function')
|
||||
|
||||
Reference in New Issue
Block a user