Commit 79f92d8 1 parent b9bd429 commit 79f92d8 Copy full SHA for 79f92d8
File tree 6 files changed +57
-4
lines changed
6 files changed +57
-4
lines changed Original file line number Diff line number Diff line change 1
1
SOURCES = lib/**/*.js
2
- TESTS ?= test/*- test.js test/**/*- test.js
2
+ TESTS ?= test/*. test.js test/**/*. test.js
3
3
4
4
lint : lint-jshint
5
- test : test-vows
6
- test-cov : test-istanbul-vows
5
+ test : test-mocha
6
+ test-cov : test-istanbul-mocha
7
7
view-cov : view-istanbul-report
8
8
9
9
Original file line number Diff line number Diff line change 36
36
"oauth" : " 0.9.x"
37
37
},
38
38
"devDependencies" : {
39
- "vows" : " 0.7.x"
39
+ "vows" : " 0.7.x" ,
40
+ "mocha" : " 1.x.x" ,
41
+ "chai" : " 1.x.x" ,
42
+ "chai-passport-strategy" : " 0.1.x"
40
43
},
41
44
"engines" : { "node" : " >= 0.4.0" },
42
45
"scripts" : {
Original file line number Diff line number Diff line change
1
+ var chai = require ( 'chai' )
2
+ , passport = require ( 'chai-passport-strategy' ) ;
3
+
4
+ chai . use ( passport ) ;
5
+
6
+
7
+ global . expect = chai . expect ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ var oauth = require('../');
6
6
7
7
vows . describe ( 'passport-oauth' ) . addBatch ( {
8
8
9
+ // OK
9
10
'module' : {
10
11
'should export InternalOAuthError' : function ( x ) {
11
12
assert . isFunction ( oauth . InternalOAuthError ) ;
Original file line number Diff line number Diff line change
1
+ var strategy = require ( '..' ) ;
2
+
3
+ describe ( 'passport-oauth' , function ( ) {
4
+
5
+ it ( 'should export Strategy constructors' , function ( ) {
6
+ expect ( strategy . OAuthStrategy ) . to . be . a ( 'function' ) ;
7
+ expect ( strategy . OAuth2Strategy ) . to . be . a ( 'function' ) ;
8
+ } ) ;
9
+
10
+ it ( 'should export Error constructors' , function ( ) {
11
+ expect ( strategy . InternalOAuthError ) . to . be . a ( 'function' ) ;
12
+ } ) ;
13
+
14
+ } ) ;
Original file line number Diff line number Diff line change
1
+ var OAuth2Strategy = require ( '../../lib/strategies/oauth2' ) ;
2
+
3
+
4
+ describe ( 'OAuth2Strategy' , function ( ) {
5
+
6
+ var strategy = new OAuth2Strategy ( {
7
+ authorizationURL : 'https://www.example.com/oauth2/authorize' ,
8
+ tokenURL : 'https://www.example.com/oauth2/token' ,
9
+ clientID : 'ABC123' ,
10
+ clientSecret : 'secret'
11
+ } , function ( ) { } ) ;
12
+
13
+ it ( 'should be named oauth2' , function ( ) {
14
+ expect ( strategy . name ) . to . equal ( 'oauth2' ) ;
15
+ } ) ;
16
+
17
+ describe ( 'constructed without a verify callback' , function ( ) {
18
+ expect ( function ( ) {
19
+ new OAuth2Strategy ( {
20
+ authorizationURL : 'https://www.example.com/oauth2/authorize' ,
21
+ tokenURL : 'https://www.example.com/oauth2/token' ,
22
+ clientID : 'ABC123' ,
23
+ clientSecret : 'secret'
24
+ } ) ;
25
+ } ) . to . throw ( TypeError , 'passport-oauth.OAuth2Strategy requires a verify callback' ) ;
26
+ } ) ;
27
+
28
+ } ) ;
You can’t perform that action at this time.
0 commit comments