generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

"grunt test" task is not running

Open lukkor opened this issue 11 years ago • 0 comments

Hi,

I used this generator for one week now and it is very useful for me but I face an issue with tests. When I run the "grunt test" task, the "karma:unit" subtask seems to fail on a server-side test (which use sinon.js) whereas the "grunt test:client" and "grunt test:server" tasks run normally (and pass). Is it normal that "karma:unit" task runs server-side tests ? Here is the output of "grunt test" task:

Running "test" task

Running "test:server" (test) task

Running "env:all" (env) task

Running "env:test" (env) task

Running "mochaTest:src" (mochaTest) task


Express server listening on 9000, in test mode
  GET /api/images
GET /api/images 200 27ms - 2b
    ✓ should respond with JSON array (76ms)

  GET /api/things
GET /api/things 200 2ms - 946b
    ✓ should respond with JSON array 

  image_resolver
    resolveHighlightedImage
      ✓ should return the URI and the description of the highlighted image 


  3 passing (108ms)


Running "test:client" (test) task

Running "clean:server" (clean) task

Running "env:all" (env) task

Running "concurrent:test" (concurrent) task

Running "injector:scripts" (injector) task
Missing option `template`, using `dest` as template instead
Injecting js files (8 files)
>> Nothing changed

Running "injector:css" (injector) task
Missing option `template`, using `dest` as template instead
Injecting css files (5 files)
>> Nothing changed

Running "autoprefixer:dist" (autoprefixer) task

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/home/ludovic/web_workspace/book/client/app/app.coffee" does not match any file.
  1) should return the URI and the description of the highlighted image
WARN [watcher]: Pattern "/home/ludovic/web_workspace/book/client/app/**/*.coffee" does not match any file.
WARN [watcher]: Pattern "/home/ludovic/web_workspace/book/client/components/**/*.coffee" does not match any file.
WARN [watcher]: Pattern "/home/ludovic/web_workspace/book/client/app/**/*.jade" does not match any file.
WARN [watcher]: Pattern "/home/ludovic/web_workspace/book/client/components/**/*.jade" does not match any file.

  3 passing (2s)
  1 failing

  1) image_resolver resolveHighlightedImage should return the URI and the description of the highlighted image:
     Uncaught TypeError: undefined is not a function
    at Object.<anonymous> (/home/ludovic/web_workspace/book/server/components/image_resolver/image_resolver.spec.js:18:9)
    at Function.invoke (/home/ludovic/web_workspace/book/node_modules/sinon/lib/sinon/spy.js:157:59)
    at Object.proxy [as readFile] (<anonymous>:1:39)
    at /home/ludovic/web_workspace/book/node_modules/karma/lib/preprocessor.js:93:15
    at /home/ludovic/web_workspace/book/node_modules/karma/lib/file_list.js:219:17
    at Object.oncomplete (fs.js:108:15)




Warning: Task "mochaTest:src" failed. Use --force to continue.

Aborted due to warnings.

I did not modify any config files. I installed sinon.js and saved it in devDependencies with npm.

Any ideas ?

lukkor avatar Feb 09 '15 19:02 lukkor