Lee Lee
Lee Lee

Reputation: 583

How to run Unit test in yeoman

I have this link to a project that is using grunt: https://github.com/brunoscopelliti/ng-unique/.

How do I run the unit tests in this project?

Upvotes: 1

Views: 79

Answers (2)

FredrikO
FredrikO

Reputation: 2052

By looking at the Gruntfile.js you can see the tasks registered.

There is currently three registered tasks;

grunt.registerTask('build-js', ['jshint', 'karma:unit', 'uglify:ngUnique']);
grunt.registerTask('build-css', ['sass:prod']);
grunt.registerTask('build-all', ['build-css', 'build-js']);

As you can see from the source, the build-js task includes running the karma:unit configuration.

To trigger this registered task, you have to run grunt build-js, or if you just want to run the Karma configuration you have to run grunt karma:unit.

Upvotes: 1

invinciblejai
invinciblejai

Reputation: 1293

grunt test

should work

you should configure your grunfile with test env as well like you have for build , debug or run, in case it's not configured i.e :

grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);

Upvotes: 2

Related Questions