How to configure ember brunch app for testing with testacular / karma?

I used brunch with ember https://github.com/fuseelements/ember-brunch-skeleton

and now I'm trying to get unit tests happening with testacular / karma (testacular has recently been renamed karma)

brunch uses require.js. when I try to start karma, I get an error message that makes me think that either the request is not loaded properly or my configuration file is corrupted.

Uncaught TypeError: Object function (deps, callback, errback, optional) { ..... has no method 'register' at app.js:82 

I assume that my configuration file is corrupted, or I forget something really simple here. here is the corresponding fragment from my karma configuration file. what am I doing wrong?

 files = [ JASMINE, JASMINE_ADAPTER, REQUIRE, REQUIRE_ADAPTER, '../public/javascripts/app_vendor.js', '../public/javascripts/app.js', 'test/**/**/*_spec.js', ]; 
+4
source share
1 answer

This is not a complete answer, but you should read the new document on running unit tests of an application created using ember with Karma: http://emberjs.com/guides/testing/test-runners/#toc_the-karma-test-runner

Also, any testing method has been excluded from brunch , which can only create files for you. I used to use karma with brunch with success and now also successfully passed through testem .

You should study this skeleton that karma uses as a test runner for an example: https://github.com/gcollazo/brunch-with-ember-reloaded

0
source

Source: https://habr.com/ru/post/1479066/


All Articles