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

Eyeglass and Async Tests #36

Closed
wants to merge 10 commits into from
Closed

Eyeglass and Async Tests #36

wants to merge 10 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 8, 2015

A suggestion for a simple and flexible way to address asynchronous tests and eyeglass functionality by allowing modules to render the test sass themselves and have true parse and print the results.

@carljm
Copy link
Member

carljm commented Jun 8, 2015

This all looks good to me, except for the function name printAssertions. It might print some stuff as a side effect (depending entirely on what mocha reporting you configure), but what that function does is run the given CSS as test assertions using the test framework utilities you pass in; it doesn't directly print anything.

I think makeTests or makeTestAssertions or runAssertions or something along those lines (something that doesn't include "print" in the name) would be preferable.

@ghost
Copy link
Author

ghost commented Jun 8, 2015

yah I already went through a few refactors on that one, just couldn't find a good fit. runAssertions sounds great to me!

@ghost
Copy link
Author

ghost commented Jun 9, 2015

Actually I'm having trouble getting this to work with the example code using the before function to wait for the sass render. It seems unless there is a describe and it function call in the same file, the before function will never be called:

before(function(done){
  // this will not run unless there is a describe it block in this same file
  sass.render(eyeglass.sassOptions(), function(err, result) {
    if (err) {
      throw err;
    } else {
      sassTrue.runAssertions(result.css, describe, it);
      done();
    }
  });
});

My experience with mocha async stuff is quite limited so looking if anyone has any ideas?

@ghost
Copy link
Author

ghost commented Jun 9, 2015

Solved it using mocha --delay.

@ghost
Copy link
Author

ghost commented Jun 10, 2015

actually I think it's a bug with node-sass

@ghost
Copy link
Author

ghost commented Jun 12, 2015

Yes this is working now with my fixed versions of node-sass and eyeglass. If you like we can still keep the refactor to allow passing in your own rendered css if anyone thinks that might be useful? Otherwise this can be closed.

@mirisuzanne mirisuzanne closed this Jul 7, 2016
@allejo
Copy link

allejo commented Nov 29, 2016

@DominicBarnard do you recall how you achieved this? Were your modifications necessary to get things working with sass-true? I may be running into this same bug

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.

3 participants