Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Switch from Jasmine to Mocha + Chai #117

Closed
paulmillr opened this issue Jun 17, 2012 · 7 comments · Fixed by #147
Closed

Switch from Jasmine to Mocha + Chai #117

paulmillr opened this issue Jun 17, 2012 · 7 comments · Fixed by #147
Assignees

Comments

@paulmillr
Copy link
Contributor

It has much nicer syntax, a lot of great reporters (like cov), it's supported (jasmine guys don't care about pull reqs) and much more.

I'll open a pull request with full syntax rewrite soon.

@ghost ghost assigned paulmillr Jun 17, 2012
@molily
Copy link
Member

molily commented Jun 17, 2012

Yeah. I guess we need to do that, sooner or later. Jasmine seems to be dead practically. Don’t know how much work the migration is, since I’m not as experienced with Mocha and Chai. I would be glad to see a pull request, thanks.

@cpsubrian
Copy link
Contributor

Just throwing my support into this. I'm using Mocha for my server-side tests and I like the syntax and reporters. This will be a great opportunity to see how people structure front-end tests (I dont have much experience with those).

@pabera
Copy link

pabera commented Jun 23, 2012

I am using Mocha, Chai and Sinon with Chaplin already after I was reading the following post by Rob Dodson. Since Chaplin updated the requirejs version to 2.0.1, I am not able to run my tests because it somehow won't load in the right order anymore. So I'll have to fix that.
But I still have shared my work here so this might help you somehow set up your environment.

@paulmillr
Copy link
Contributor Author

@pabera just in case you didn't know — brunch with chaplin (commonjs version of chaplin-boilerplate + some additions) have mocha + chai + sinon tests already and ability to run it through command line. feel free to take stuff from there

@pabera
Copy link

pabera commented Jun 23, 2012

@paulmillr I know brunch - I like the whole idea of it too but since it does not use AMD over CommonJs, I did not use it .. I probably give it a try again some time but I started my projects the AMD way and it seemed to be a lot of work to switch. If I don't get those tests to work again, I'll be considering this anyway :) Thanks for your quick answer tough.

@molily
Copy link
Member

molily commented Jun 24, 2012

I am using Mocha, Chai and Sinon with Chaplin already after I was reading the following post by Rob Dodson. Since Chaplin updated the requirejs version to 2.0.1, I am not able to run my tests because it somehow won't load in the right order anymore. So I'll have to fix that.

Hmm, what’s the problem with RequireJS 2? Probably you’re missing the order plugin, but that shouldn’t be necessary any longer. The general idea of m12n is to have proper dependency declarations for all modules so the load order can be computed automatically. Manually enforcing a specific load order should not be necessary if module dependencies are declared correctly.

Seems like you’re relying on global variables, setting timeouts manually probably to wait for some modules to be loaded, and you’re using the deprecated priority configuration option. Sure, this practise is against a consistent m12n approach and may fail under specific circumstances.

@pabera
Copy link

pabera commented Jun 25, 2012

Thanks for your comment, unfortunately the concerns that you claimed to be the possible failure sources are my efforts to get all this to work. I do have proper dependencies throughout my chaplin application using requirejs 2 and it loads correctly by itself. But when it comes to testing I need to set up the environment correctly that works together with mocha, chai and so on. So settings timeouts, using priority where just ideas I came up.. Well but these personal issues do not belong to the actual issue report :)

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

Successfully merging a pull request may close this issue.

4 participants