Closed timwienk closed 9 years ago
I read thru the changes and found nothing strange/wrong. Sent it to Travis also. Got green all over. I'm easy about changing to Mocha or staying with Jasmine.
Nice job! Thank you for the time you put into this! :+1:
Very nice!
A few things:
Some tests are disabled with using xdescribe, for example https://github.com/timwienk/mootools-core/compare/spec-update-part-3...spec-update-part-4#diff-d7242700ac47efe4e538390355c32968R50
Is that still valid, or was it disabled at some point and never enabled again?
expect(..).to.be.true
, where true
is a keyword. iirc that doesn't work in IE8, and should be to.be['true']
. Is that relevant? (https://github.com/chaijs/chai/issues/124#issuecomment-11639702)Some tests are disabled with using xdescribe, for example https://github.com/timwienk/mootools-core/compare/spec-update-part-3...spec-update-part-4#diff-d7242700ac47efe4e538390355c32968R50 Is that still valid, or was it disabled at some point and never enabled again?
The specs where there's now xdescribe
, there used to be a xit
, so yea, they were disabled and never re-enabled. I believe they're tests from our old spec engine with PHP stuff. [intended]
I did just realise that if they were enabled, they'd fail now, because Mocha uses arguments to done
as reasons a spec failed, while Jasmine has done.fail
for that. [fixed]
chai uses expect(..).to.be.true, where true is a keyword. iirc that doesn't work in IE8, and should be to.be['true']. Is that relevant? (https://github.com/chaijs/chai/issues/124#issuecomment-11639702)
That's a good point. I kind of assumed they made it work. The best workaround is probably to use replace to.be.true
with to.equal(true)
. The same thing should be the case for to.be.false
and to.be.null
. Will look into that. [fixed]
It should be fine for to.be.undefined
, however, for the sake of consistency, maybe we should replace those as well. [fixed]
That's a good point. I kind of assumed they made it work. The best workaround is probably to use replace to.be.true with to.equal(true). The same thing should be the case for to.be.false and to.be.null. Will look into that.
This is one of the reasons I initially used https://github.com/Automattic/expect.js (and kept using it since, I think chai wasn't really a thing then, the other choice was 'should.js').
This is one of the reasons I initially used https://github.com/Automattic/expect.js (and kept using it since, I think chai wasn't really a thing then, the other choice was 'should.js').
Chai seems a very complete solution, including assert
style assertions as well, which could benefit us in the future. However, if things don't work in IE older than 9, we should probably switch. Although I prefer some specific things Chai did with the expect
syntax, the syntax of all expect
style things are very similar anyway. [fixed]
After looking at things, they clearly state they don't support IE<9, so Chai is not an option. I replaced it with the library Arian suggested, expect.js. [fixed]
:+1:
New issues encountered:
transports: ['polling'], forceJSONP: true
to socket.io, but Karma doesn't allow for the forceJSONP
option to be passed right now.sinon-ie
for old IE, this would be annoying when testing locally(/manually), since you need different karma-plugins for different envs.<a href="javascript:something()" />
in IE9 and IE10 causes a page reload of which Karma doesn't approve.Latest test results: https://travis-ci.org/timwienk/mootools-core/builds/82323286
Nice work!
I am ok with merging these to master branch.
@arian: Add node_js 4 here as well?
Never mind, it's already included in the other matrix.
Yes, what I changed in .travis.yml
is: instead of adding the multiple node_js versions when building the matrix, only one is used for that, and the non-current versions are "manually" included after the matrix is built for only server testing. That way we don't have 75 runs of which 48 actually do nothing.
@arian: However if you use version
4
, will it automatically use the latest 4.x version? As they are using proper semver now, all 4.x versions should automatically work.
That's a good point, I'll change that and hopefully they indeed don't break within the major version. :-D [fixed]
https://travis-ci.org/timwienk/mootools-core/builds/82406894
Okay, so everything seems to work. Now for the last two questions:
I say same as @arian.
I decided to update our specs a bit, for a number of reasons:
When I started doing this, I didn't know how much work it'd be, and luckily it wasn't too bad. The problem is, though, that it'll look like a lot and it'll be a hell to review because of the sheer number of changes.
To be able to review it I split it up in parts, and I would like to suggest to review it by part, we could even merge it in by part. I didn't create Pull Requests, because every next Pull Request would include the changes from the previous Pull Request since they're not merged at this point. When reviewed, I guess they could be merged in, and I could actually create a Pull Request for every next one to make that easier.
So, the parts:
$$
spec actually turned out to be broken after adding actual elements to select.Tests/Utilities
and includedsyn
andsinon
packages instead, addedTests/Plugins/syn
to usesyn
in karma. Last commit re-adds a local version ofsyn
(hopefully temporarily).At the point of any of these commit the specs should still run fine and turn all green, I made the changes step-by-step to not accidentally change behaviours. (In fact, if we want to stick with Jasmine, we could decide to stop after part 5, or even after the expect.js commit of part 6.) The only exception to this is the Chai commit of part 6, everything runs fine, but Chai doesn't support IE older than 9, keeping the commit for history and reasoning, though.
In case it's easier (it probably is), I should be in IRC most of the time for comments or anything related.
Note for later: There are some things I didn't touch, like the test "bootstrapping". I think after these changes, it might be a good idea to look at the
Gruntfile.js
and files in theTests
directory. It looks like these things could be restructured to be easier to understand.