-
-
Notifications
You must be signed in to change notification settings - Fork 73
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: fix error assertions #264
Conversation
test/Errors.test.js
Outdated
// FIXME: this is resolving to nearest postcss config (outside root) | ||
// test('Loading Config - {Error}', async () => { | ||
// await rejects(() => postcssrc({}, 'test/err'), { | ||
// message: /^No PostCSS Config found in: (.*)$/ | ||
// }) | ||
// }) |
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.
not fully sure what's the expected behavior here, but this is not throwing any error and resolving to test/postcss.config.mjs
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.
Seems like this test never moved to match
area (this is why rejects
is better).
As I understand it should ignore error in broken config and return No PostCSS Config found in
. What is current behaviour in this test?
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.
Ah, currently there is no postcssrc file directly inside test/err
. Running postcssrc({}, 'test/err')
is not failing and returning content from test/postcss.config.mjs
(one directory up the passed directory). Should it fail if there is no config directly inside the specified path?
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.
Let’s remove test. It is rare case and test didn’t work for a while.
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.
Done.
Thanks! |
Notable Changes
.catch
+match
/equals
doesn't assert that a particular call throws error. It just asserts IF an error is thrown it will satisfy assertions inside. Consequently, it will pass the test even if something doesn't throw while it should.Type
SemVer
Checklist