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 built-in functions #1001

Open
nex3 opened this issue Dec 12, 2016 · 2 comments
Open

Add specs for built-in functions #1001

nex3 opened this issue Dec 12, 2016 · 2 comments

Comments

@nex3
Copy link
Contributor

nex3 commented Dec 12, 2016

All the built-in functions need thorough specs that exercise their edge and error cases. There isn't currently a great structure in place for this; some functions have some specs scattered around the repo, but there should be a uniform location and we should make sure all functions are tested.

Ruby Sass has good test coverage for functions, so the best way to go about this is probably porting those. I suggest the following structure:

spec/
'-- core_function/
    |-- color/
    | ...
    '-- number/
        |-- round/
        | ...
        '-- max/
            |-- success/
            |   |-- input.scss
            |   '-- expected_output.scss
            '-- error/
                |-- type_error_arg1/
                |   |-- input.scss
                |   '-- expected_output.scss
                '-- type_error_arg2/
                    |-- input.scss
                    '-- expected_output.scss

For functions with more complex modes of operation, we could replace success/ with multiple test cases.

@nex3
Copy link
Contributor Author

nex3 commented Dec 12, 2016

We should also retrofit the existing spec/colors/, spec/number-functions/, and spec/selector-functions/ into this format.

For the time being, I'm adding this structure lazily when I need to create a spec for a function.

nex3 added a commit that referenced this issue Jul 18, 2018
This moves the specs to the directories suggested in
#1001, updates them to use get-function(), and documents
the exact issues that they're testing.

It also updates the output of one of them to be an error, which is
expected.
nex3 added a commit that referenced this issue Nov 7, 2018
nex3 added a commit that referenced this issue Nov 12, 2018
nex3 added a commit that referenced this issue Feb 29, 2020
nex3 added a commit that referenced this issue Mar 2, 2020
nex3 added a commit that referenced this issue Mar 4, 2020
nex3 added a commit that referenced this issue Mar 4, 2020
nex3 added a commit that referenced this issue Mar 6, 2020
@stof
Copy link
Contributor

stof commented Feb 26, 2022

@nex3 Can this be considered done now ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants