kwk / docker-registry-frontend

Browse and modify your Docker registry in a browser.
https://registry.hub.docker.com/u/konradkleine/docker-registry-frontend/
MIT License
1.68k stars 616 forks source link

Make "npm test" run Karma tests #140

Closed msabramo closed 8 years ago

msabramo commented 8 years ago

This makes npm test run unit tests with Karma. I also added some tests for routes in app/app.spec.js.

Result is this:

[marca@marca-mac2 docker-registry-frontend_2]$ 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

11 07 2016 19:39:20.266:WARN [karma]: No captured browser, open http://localhost:8080/
11 07 2016 19:39:20.276:WARN [karma]: Port 8080 in use
11 07 2016 19:39:20.277:INFO [karma]: Karma v1.1.1 server started at http://localhost:8081/
11 07 2016 19:39:20.277:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
11 07 2016 19:39:20.312:INFO [launcher]: Starting browser PhantomJS
11 07 2016 19:39:20.781:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#fVTIrC5Oir1PvLqcAAAA with id 38487814

  docker-registry-frontend
    ✓ /home should display home page
    ✓ /repositories should display repository list page
    ✓ /repositories/10 should display repository list page
    ✓ /repositories/20 should display repository list page
    ✓ URL with repositoryUser and repositoryName and no tagsPerPage should display repository detail page
    ✓ URL with repositoryUser and repositoryName and tagsPerPage should display repository detail page
    ✓ URL with repositoryName but no repositoryUser and tagsPerPage should display repository detail page
    ✓ /about should display about page
    ✓ /tag/repositoryUser/repositoryName/latest should display tag detail page
    ✓ /image/88e37c7099fa should display image detail page
    ✓ /image/88e37c7099fa/tag should display create tag page
    ✓ /unknown-url should display home page

  RepositoryListController
    ✓ should attach some keys to the scope

  MainController
    ✓ should attach an appVersion and registryHost to the scope

PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 14 of 14 SUCCESS (0.008 secs / 0.082 secs)
TOTAL: 14 SUCCESS

Fixes #139

kwk commented 8 years ago

@msabramo Thank you so much for contributing tests to this project. It should help getting all the open PRs merged in more quickly.