Skip to content
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 specs for content-exists in control statements #1361

Closed
wants to merge 1 commit into from

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented Mar 16, 2019

See sass/libsass#2842

[skip libsass]

@xzyfer xzyfer self-assigned this Mar 16, 2019
xzyfer added a commit to sass/libsass that referenced this pull request Mar 16, 2019
It's not enough to check the head of the stack to determine if we're
within a mixin.

Spec sass/sass-spec#1361
Fixes #2842
xzyfer added a commit to sass/libsass that referenced this pull request Mar 16, 2019
It's not enough to check the head of the stack to determine if we're
within a mixin.

Spec sass/sass-spec#1361
Fixes #2842
xzyfer added a commit to sass/libsass that referenced this pull request Mar 16, 2019
It's not enough to check the head of the stack to determine if we're
within a mixin.

Spec sass/sass-spec#1361
Fixes #2842
xzyfer added a commit to sass/libsass that referenced this pull request Mar 16, 2019
It's not enough to check the head of the stack to determine if we're
within a mixin.

Spec sass/sass-spec#1361
Fixes #2842
xzyfer added a commit to sass/libsass that referenced this pull request Mar 16, 2019
It's not enough to check the head of the stack to determine if we're
within a mixin.

Spec sass/sass-spec#1361
Fixes #2842
@nex3 nex3 self-requested a review March 18, 2019 21:19
Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Michael! I'm trying to (gradually) clean up and normalize the way specs are laid out in this repo. I've written some initial guidance on how to to organize specs in the new README, and I'm hoping to flesh that out into a full-fledged style guide soon, but in the meantime I guess I'll just comment ad hoc on pull requests.

  • Please merge all these specs into a single content_exists.hrx file. Generally speaking, specs for a given feature should be in as few HRX files as possible without going over ~500 lines per file.

  • HRX files function as virtual directories, so there's no need to move basic.hrx and error.hrx into basic and error directories.

  • Please split each assertion ("content-exists() returns true when called from within a mixin with @content" and "content-exists() returns false when called from within a mixin without @content") into a separate spec. Now that we have HRX, it's feasible to write small tightly-scoped specs that test one thing each without creating a million files, which is generally a better testing practice.

}
}

.should-be-true {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd call these classes .with-content and .without-content. It's already clear what the expected result is, since it's right there in the output file, so it's more useful to document what's meaningfully different about how they're invoked.

Actually, when you split these into separate specs, you should probably put with_content and without_content into the test names and just make these selector names a.

@nex3
Copy link
Contributor

nex3 commented Mar 18, 2019

Also, please don't mark a PR as "skip dart-sass" unless it's paired with a Dart Sass PR that's running against this PR. Otherwise, master will go red once this lands. I've removed the "skip" line in the description and re-run the tests.

@stof
Copy link
Contributor

stof commented May 5, 2021

@Awjin this PR should be closed now, as #1637 replaced it

@Awjin Awjin closed this May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants