-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Adjust test to pass with slower GHA macOS box #1051
Conversation
@JoshuaWise this is blocking the upgrade to SQLite 3.43. |
expect(() => (this.db = new Database(util.current(), { timeout: -1 }))).to.throw(TypeError); | ||
expect(() => (this.db = new Database(util.current(), { timeout: 75.01 }))).to.throw(TypeError); | ||
expect(() => (this.db = new Database(util.current(), { timeout: 0x80000000 }))).to.throw(RangeError); | ||
for (const { timeout, err } of [ |
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.
I find this offensively worse to read tbh 😄
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.
Yeah, the first time I saw specs written like this, I found it a bit off, as well! Tabular specs have grown on me, though, to the point where I strongly prefer them. It allows you to DRY up your spec, ensures the same operation is being performed with all the different inputs, and most importantly, highlights the input and expected results.
One of the assertions was failing, and I wanted to add the JSON context to it. One solution would be to extract 7 new it
's with specific test names, but Josh doesn't follow the one-test-one-spec rule--so I wanted to add the timeout description to the context, but that caused every expectation to linewrap, which was really effective in hiding what the tests were doing.
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.
(That said, if @JoshuaWise would rather me rewrite this diff, I don't really care--I just want the PR to go through)
Closing this in favor of 6ee3399. This is also related to #597. I've enabled the long-overdue |
This should allow the upgrade to 3.43 to pass:
Failure from GHA:
https://github.com/WiseLibs/better-sqlite3/actions/runs/5965363532/job/16186656443?pr=1050