Closed bitpshr closed 11 years ago
Heya,
This is badass! I really loathed Mocha by the time I was done hacking it all into place. Any chance you can rebase? Else, I'm happy to do the merge manually. Either way, thank you SO much for the outstanding contribution.
No problem at all! I will rebase and also bring Intern up to the latest version.
This should be good to go. A few notes:
There seems to be a failing test in tests/apitest
, though I don't know the cassowary codebase well enough to know if this is exposing an actual bug, or if the test itself is faulty:
FAIL: main - new api - informs on variable changes (3ms)
Error: expected { b: 6, a: 1 } to have a property 'c'
121/122 tests passed
If any conflicts arise with the merge or if anything looks off, let me know and I'll do my best to take care of it.
@bitpshr: the failing test used to pass, but is also very delicate. I will work on a more resilient version. I don't think it has anything to do with your changes except that the code is being run in a different context.
Merged. We can fix in trunk.
HUGE kudos to you @bitpshr. WELL PLAYED.
All this means is I need a life. I am glad to have helped out a bit with cassowary!
Ok, I'm not seeing any logic in api.js
for change tracking, which I think just means this test is predicting the future, not testing the current state. Commenting it out and moving on.
@slightlyoff: it's in there at https://github.com/slightlyoff/cassowary.js/blob/master/src/parser/api.js#L67 and the test was passing until this PR but is very unstable because we aren't clearing out the state of the solver behind the parser api when the test runs. I'm working on a fix.
Aaaaaaahhhhhh...OK.
We should perhaps chat about that API in another issue = )
Yeah no one was super happy with it, the old discussion is at https://github.com/slightlyoff/cassowary.js/pull/35.
After checking out the cassowary.js tests, I noticed there were a few hacks to get Mocha to behave properly. Further, it didn't have true standalone browser support, a way to easily test against all browsers, or a way to generate code coverage. I also was extremely bored and had to kill some time today, so I decided to switch the tests to use Intern instead.
npm test
tests/unittests.html?config=tests/intern
Note: performance results are displayed onscreen, like before, and unit test results are grouped in the console.node node_modules/intern/runner.js config=tests/intern
_Note: The simplest way to run tests against Selenium is by using SauceLabs. Just create an account, and exposeSAUCE_USERNAME
andSAUCE_ACCESS_KEY
as environment variables. Intern takes care of the rest._node node_modules/intern/runner.js config=tests/intern reporters=lcov
Note: Requires a Selenium server, see step above. This will generate anlcov.info
file. As with any lcov report, an html page can be generated to view results usinggenhtml lcov.info
.