I would like to test my meteor-angular app. I installed the packages angular:angular-mocks
and angular:angular-mocks
.
Then I created a file: Client/test/first.test.js
I have inserted the following code:
import chai from 'meteor/practicalmeteor:chai';
describe('MessageCtrl', function () {
beforeEach(angular.module('myApp'));
it('does something that should be tested', function () {
var expect = chai.expect;
expect("foo").to.be.a('string');
})
});
The tests I have started with meteor test -setting settings.json --driver-package practicalmeteor:mocha
, but I always get the error:
angular_angular.js?hash=ba46867…:93Uncaught Error: [$injector:nomod]
Module 'myApp' is not available!
You either misspelled the module name or forgot to load it.
If registering a module ensure that you specify the dependencies
as the second argument
What am I doing wrong? I thought Meteor automatically integrated all the files.
Thanks
Update
Make a import with import '../lib/app.ng.js'
do nothing change.