Skip tests in an Angular project generated with Yo

I am doing a small toy project for testing Yeomen and angular.

After building the application with yo angular I started writing a service and its tests. Everything was perfect until I tried to ignore the test.

From what I read, I should be able to ignore changing the test it to xit and the costume changing describe to xdescribe .

But when I save and scold, run the tests, I get the error 'xit' is not defined or 'xdescribe' is not defined .

Is there something I am missing?

+6
source share
1 answer

You will need to edit or create a file called .jshintrc, and you will have something like this:

  {
     "curly": false,
     "eqeqeq": false,
     "immed": true,
     "latedef": true,
     "newcap": true,
     "noarg": true,
     "sub": true,
     "undef": true,
     "boss": true,
     "eqnull": true,
     "browser": true,
     "es5": true,
     "smarttabs": true,
     "expr": true,
     "globals": {
         "angular": true,
         "console": true,
         "expect": true,
         "inject": true,
         "describe": true,
         "beforeEach": true,
         "it": true,
         "xit": true,
         "xdescribe": true
     }
 }

Pay attention to xit and xdescribe under global values.

In your grunt file go to jshint task and do it

 
 jshint: {
       options: {
         jshintrc: '.jshintrc'
       }
 }
+4
source

All Articles