Question

I am running Jasmine tests, currently about 1900 tests in spec. It takes about 45 seconds for the tests to start running. Even when I am running a single test.

One thing I noticed is that when I run a single test it loads every fixture, javascript file, compiles every coffeescript and every less file. How can I make it so that only the required files are compiled for the test?

Was it helpful?

Solution

You can use ddescribe to run only a single suite of tests in jasmine. But of course, youll need to update that in the test code.

http://tobyho.com/2012/09/12/better-tdd-workflow-via-exclusive-tests-in-jasmine-and-mocha/

OTHER TIPS

Look into requirejs for better loading of tests and bundling of tests.

Also, providing a bit more details about your structure of tests would be helpful. Are all of them in separate files? Are you loading them from within a js file or loading from a html file?

This tutorial is directed towards testing Backbonejs components but it talks about requirejs and can be helpful: http://kilon.org/blog/2012/08/testing-backbone-requirejs-applications-with-jasmine/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top