-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add a style guide for writing new specs #1363
Conversation
I've tried to capture the best practices I've come up with while writing tests in the HRX format, mixed with best practices from other testing traditions and a few rules that mostly serve to just establish a consistent style.
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 is a great resource. Looking forward to someone updating the older tests. 😃
|
||
[implementation-specific expectations]: README.md#implementation-specific-expectations | ||
|
||
### DO use Dart Sass's output as the default |
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.
Does this also apply to errors? Currently, dart-sass errors are sometimes inferior to ruby and libsass, e.g.:
libsass and ruby:
Invalid CSS after "... (foo: bar) or ": expected @supports condition (e.g. (display: flexbox)), was "{"
dart-sass:
expected "("
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.
Yes. This isn't about saying which errors are best, it's just about being consistent in formatting. If any implementation's errors need improvement, that's something that should be handled on that implementation's issue tracker, not by swapping output positions in the specs.
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.
If error
is not what we want the canonical error message to look like, but is merely the current error message of dart-sass, perhaps all errors should be language-specific?
I.e. no error
, only error-dart-sass
and error-libsass
.
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 think that could be a reasonable approach. Let's discuss it on a separate issue, though; until the infrastructure supports it, I'd like to keep this as the recommended approach.
I've tried to capture the best practices I've come up with while
writing tests in the HRX format, mixed with best practices from other
testing traditions and a few rules that mostly serve to just establish
a consistent style.