Check for forgotten console and debugger statements

This commit is contained in:
Steve Gravrock
2020-09-17 13:33:25 -07:00
parent 795651d3b6
commit 7d5ca27b9d
4 changed files with 13 additions and 1 deletions

View File

@@ -13,5 +13,11 @@ module.exports = {
"no-unused-vars": "off",
"no-trailing-spaces": "off",
"block-spacing": "off",
// Since linting is done at the end of the process and doesn't stop us
// from running tests, it makes sense to fail if debugger statements
// or console references are present.
"no-debugger": "error",
"no-console": "error",
}
}
};

View File

@@ -2316,6 +2316,7 @@ describe("Env integration", function() {
expect(result.deprecationWarnings).toEqual([
jasmine.objectContaining({ message: 'top level deprecation' })
]);
/* eslint-disable-next-line no-console */
expect(console.error).toHaveBeenCalledWith('DEPRECATION: top level deprecation');
expect(reporter.suiteDone).toHaveBeenCalledWith(jasmine.objectContaining({
@@ -2324,6 +2325,7 @@ describe("Env integration", function() {
jasmine.objectContaining({ message: 'suite level deprecation' })
]
}));
/* eslint-disable-next-line no-console */
expect(console.error).toHaveBeenCalledWith('DEPRECATION: suite level deprecation (in suite: suite)');
expect(reporter.specDone).toHaveBeenCalledWith(jasmine.objectContaining({
@@ -2332,6 +2334,7 @@ describe("Env integration", function() {
jasmine.objectContaining({ message: 'spec level deprecation' })
]
}));
/* eslint-disable-next-line no-console */
expect(console.error).toHaveBeenCalledWith('DEPRECATION: spec level deprecation (in spec: suite spec)');
done();

View File

@@ -32,6 +32,7 @@ describe("matchersUtil", function() {
// Be thorough but very slow when specified (usually on CI).
if (process.env.JASMINE_LONG_PROPERTY_TESTS) {
/* eslint-disable-next-line no-console */
console.log(
'Using',
many,

View File

@@ -104,6 +104,7 @@ describe('HtmlReporter', function() {
passedExpectations: [],
failedExpectations: []
});
/* eslint-disable-next-line no-console */
expect(console.warn).toHaveBeenCalledWith(
"Spec 'Some Name' has no expectations."
);
@@ -118,6 +119,7 @@ describe('HtmlReporter', function() {
passedExpectations: [],
failedExpectations: []
});
/* eslint-disable-next-line no-console */
expect(console.error).toHaveBeenCalledWith(
"Spec 'Some Name' has no expectations."
);