-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: enable ESLint's recommended JS rules #5282
base: main
Are you sure you want to change the base?
Changes from all commits
54695d8
ed6710a
4a59df3
8900df8
6608ddd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,9 @@ describe('Runnable(title, fn)', function () { | |
var run; | ||
|
||
beforeEach(function () { | ||
run = new Runnable('foo', function (done) {}); | ||
run = new Runnable('foo', function (done) { | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should be .async', function () { | ||
|
@@ -387,7 +389,7 @@ describe('Runnable(title, fn)', function () { | |
}); | ||
|
||
it('should not throw its own exception if passed a non-object', function (done) { | ||
var runnable = new Runnable('foo', function (done) { | ||
var runnable = new Runnable('foo', function () { | ||
/* eslint no-throw-literal: off */ | ||
throw null; | ||
}); | ||
|
@@ -401,7 +403,7 @@ describe('Runnable(title, fn)', function () { | |
|
||
describe('when an exception is thrown and is allowed to remain uncaught', function () { | ||
it('throws an error when it is allowed', function (done) { | ||
var runnable = new Runnable('foo', function (done) { | ||
var runnable = new Runnable('foo', function () { | ||
throw new Error('fail'); | ||
}); | ||
runnable.allowUncaught = true; | ||
|
@@ -466,8 +468,13 @@ describe('Runnable(title, fn)', function () { | |
it('should allow updating the timeout', function (done) { | ||
var spy = sinon.spy(); | ||
var runnable = new Runnable('foo', function (done) { | ||
setTimeout(spy, 1); | ||
setTimeout(spy, 100); | ||
setTimeout(function () { | ||
spy(); | ||
setTimeout(function () { | ||
spy(); | ||
done(); | ||
}, 50); | ||
}, 10); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tweaked this to have a bit smaller of a total There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything else looks good so I'm happy to approve, but I'm too new to comment on this one, hoping someone else can weigh in to confirm no breaking changes or anything! |
||
}); | ||
runnable.timeout(50); | ||
runnable.run(function (err) { | ||
|
@@ -509,7 +516,7 @@ describe('Runnable(title, fn)', function () { | |
|
||
describe('when the promise is fulfilled with a value', function () { | ||
var fulfilledPromise = { | ||
then: function (fulfilled, rejected) { | ||
then: function (fulfilled) { | ||
setTimeout(function () { | ||
fulfilled({}); | ||
}); | ||
|
@@ -626,6 +633,7 @@ describe('Runnable(title, fn)', function () { | |
var runnable = new Runnable('foo', function (done) { | ||
// normally "this" but it gets around having to muck with a context | ||
runnable.skip(); | ||
done(); | ||
}); | ||
runnable.run(function (err) { | ||
expect(err, 'to be undefined'); | ||
|
@@ -641,6 +649,7 @@ describe('Runnable(title, fn)', function () { | |
runnable.skip(); | ||
/* istanbul ignore next */ | ||
aborted = false; | ||
done(); | ||
}); | ||
runnable.run(function () { | ||
process.nextTick(function () { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a TODO for a subsequent PR, to keep the diff small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And
no-var
for sure!