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

Fixing the detection integral tests #150

Closed
wants to merge 2 commits into from
Closed

Conversation

kizu
Copy link
Contributor

@kizu kizu commented Dec 27, 2013

Warning: This branch should be rebased and merged after #148 is reviewed and merged into dev.


This fixes the integral detection tests from the tests refactoring happened in the #147

@tonyganch
Copy link
Member

@kizu, what is the difference between those two tests (the first one and the last one)?

var config = this.comb.getConfig('csscomb');
this.comb.configure(config);
this.shouldBeEqual('integral.css', 'integral.expected.css');
var expected = {...};
var config = this.comb.getConfig('csscomb');
expected['sort-order'] = config['sort-order'];
this.comb.configure(expected);
this.shouldBeEqual('integral.css', 'integral.expected.css');

The last one does not involve detect at all.

@ghost ghost assigned mishanga Dec 27, 2013
@kizu
Copy link
Contributor Author

kizu commented Dec 27, 2013

Hmm, I used this test to test if the config equal to the detected from expected (+ the absent sord-order option) would work to comb the integral.css. This way if we would add a new option that won't have the detect method, and there would be an integral test for this option, this test would fail.

I'm not sure we should have this test there, but added it anyway. If you'd like, I can remove it :)

@tonyganch
Copy link
Member

I think it should be removed, yes.
It does not test anything that is not checked with the two previous cases already.

We can also remove hard coding of expected object.
If we need a modified clone of csscomb config, we can just get it:

var expected = this.comb.getConfig('csscomb');
delete expected['sort-order'];

(�↑ That's not necessary, just thinking out loud)

@kizu
Copy link
Contributor Author

kizu commented Dec 27, 2013

Ok, done. Agree on removing the hardcoded expected, however there were a few other things to do there to make it work (clone this expected object to prevent other tests to fail, sort those objects in the shouldDetect method, remove the exclude option from the config got).

@mishanga
Copy link
Contributor

mishanga commented Jan 8, 2014

@kizu rebase please?

@kizu
Copy link
Contributor Author

kizu commented Jan 8, 2014

Rebased (it should be merged after the #148)

mishanga added a commit that referenced this pull request Jan 9, 2014
Fixing the detection integral tests
@mishanga mishanga closed this Jan 9, 2014
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