Skip to content

Commit

Permalink
Make "npm test" run Karma tests
Browse files Browse the repository at this point in the history
Result is this:

```
$ npm test

> docker-registry-frontend@0.0.2 pretest /Users/marca/dev/git-repos/docker-registry-frontend_2
> npm install

> docker-registry-frontend@0.0.2 postinstall /Users/marca/dev/git-repos/docker-registry-frontend_2
> bower install

> docker-registry-frontend@0.0.2 test /Users/marca/dev/git-repos/docker-registry-frontend_2
> karma start test/karma.conf.js

09 07 2016 13:36:20.771:WARN [karma]: No captured browser, open http://localhost:8080/
09 07 2016 13:36:20.781:INFO [karma]: Karma v1.1.1 server started at http://localhost:8080/
09 07 2016 13:36:20.782:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
09 07 2016 13:36:20.788:INFO [launcher]: Starting browser PhantomJS
09 07 2016 13:36:21.250:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#Z4MF21dfMgThOi3zAAAA with id 9538616
PhantomJS 2.1.1 (Mac OS X 0.0.0) Controller: MainCtrl should attach a list of awesomeThings to the scope FAILED
	forEach@bower_components/angular/angular.js:326:24
	loadModules@bower_components/angular/angular.js:4115:12
	createInjector@bower_components/angular/angular.js:4041:22
	workFn@bower_components/angular-mocks/angular-mocks.js:2464:60
	loaded@http://localhost:8080/context.js:151:17
	bower_components/angular/angular.js:4155:53
	TypeError: undefined is not an object (evaluating 'scope.awesomeThings') in test/spec/controllers/main.js (line 20)
	test/spec/controllers/main.js:20:17
	loaded@http://localhost:8080/context.js:151:17
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.005 secs / 0.006 secs)
```

Fixes #139
  • Loading branch information
msabramo committed Jul 10, 2016
1 parent d5dd87d commit 1c69917
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,24 @@
"grunt-svgmin": "^3.1.2",
"grunt-usemin": "^3.1.1",
"grunt-wiredep": "^2.0.0",
"jasmine": "^2.4.1",
"jasmine-core": "^2.4.1",
"jshint-stylish": "^2.1.0",
"karma": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.1",
"load-grunt-tasks": "^3.4.0",
"time-grunt": "^1.3.0"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "grunt test"
"postinstall": "bower install",

"pretest": "npm install",
"test": "karma start test/karma.conf.js",
"test-single-run": "karma start test/karma.conf.js --single-run"
},
"description": "A pure web-based frontend to a docker-registry",
"main": "Gruntfile.js",
Expand Down
3 changes: 1 addition & 2 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module.exports = function(config) {
'bower_components/angular-route/angular-route.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-touch/angular-touch.js',
'app/scripts/**/*.js',
'test/mock/**/*.js',
'app/**/*.js',
'test/spec/**/*.js'
],

Expand Down
22 changes: 0 additions & 22 deletions test/spec/controllers/about.js

This file was deleted.

0 comments on commit 1c69917

Please sign in to comment.