tafax / angular-digest-auth

AngularJS module to manage HTTP Digest Authentication
MIT License
28 stars 6 forks source link

tests seem to fail? #20

Open wu-lee opened 9 years ago

wu-lee commented 9 years ago

I'm attempting to submit a patch for the WWW-Authenticate parser function. As part of that I'd like to add a test. However, the tests don't seem to run for me.

There are no instructions and I'm a little new to the grunt/bower/npm toolchain so there's some guesswork involved. But, on the current master branch (i.e. no changes added by me):

grunt karma

Fails because:

Specifically:

ERROR [launcher]: Cannot start Opera
    Can not find the binary opera
    Please set env variable OPERA_BIN

Removed 'Opera' from browsers list in karma.conf.js for now.

e.g.

 Firefox 42.0.0 (Ubuntu) ERROR
    ReferenceError: angular is not defined
    at src/angular-digest-auth.js:7

Specifically:

Firefox 42.0.0 (Ubuntu) angular-digest-auth tests with no server info or credentials stored should ask for the info and credentials and then sign in FAILED
    ReferenceError: SyncStrategy is not defined
    StateMachineProvider/this.$get<@/home/nick/tmp/angular-digest-auth/lib/angular-state-machine/src/services/state-machine.js:121:9
    e@/home/nick/tmp/angular-digest-auth/lib/angular/angular.min.js:39:191
    [...]

Likewise for npm test, which runs grunt travis --verbose. This does not seem to be a problem

Additionally, the pull requests I submitted fail to build; this may be because of a different reason, the error seems to be:

Fatal error: Arguments to path.join must be strings
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

(See here; Googling finds this which suggests grunt-bower needs to be updated)

Anyway, advice welcome.

Thanks

wu-lee commented 9 years ago

For the record, I am using latest grunt / npm on Ubunty Trusty.

$ cat /etc/issue
Ubuntu 14.04.3 LTS \n \l
$ npm --version
1.4.28
$ grunt --version
grunt-cli v0.1.13
grunt v0.4.5
wu-lee commented 9 years ago

I also see problems from karma, which abort the build:

$ grunt test --verbose
[...]
Options: background=false, clientArgs={"_":["test"],"verbose":true,"$0":"/home/nick/.npm-packages/bin/grunt"}, client={"args":{"_":["test"],"verbose":true,"$0":"/home/nick/.npm-packages/bin/grunt"}}, configFile="karma.conf.js"
WARN `start` method is deprecated since 0.13. It will be removed in 0.14. Please use 
  server = new Server(config, [done])
  server.start()
instead.

Warning: Invalid configuration: client.args must be an array of strings Use --force to continue.

Aborted due to warnings.

But it looks like these and some of the other initial problems can be resolved by updating to a recent version of karma:

npm update karma optimist grunt-karma --save-dev

This does not resolve the problems with an absence of SyncStrategy, and Opera.