/
errors.js
96 lines (73 loc) · 2.4 KB
/
errors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//var Lelylan = require('./../lib/lelylan-node.js')({ 'token': '5f7fb8f11b8499b' });
//var nock = require('nock');
//var request, response, error;
//describe('Lelylan Error',function() {
//describe('with status code 500',function() {
//beforeEach(function(done) {
//request = nock('http://api.lelylan.com').get('/devices/1').reply(500, 'Internal Server Error');
//done();
//})
//beforeEach(function(done) {
//Lelylan.Device.find('1', function(e, r) {
//error = e; response = r; done();
//})
//})
//it('makes the HTTP request', function() {
//request.isDone();
//});
//it('return a json array',function() {
//error.should.be.a('object');
//});
//});
//describe('with status code 401',function() {
//beforeEach(function(done) {
//request = nock('http://api.lelylan.com').get('/devices/1').replyWithFile(401, __dirname + '/fixtures/errors/401.json');
//done();
//})
//beforeEach(function(done) {
//Lelylan.Device.find('1', function(e, r) {
//error = e; response = r; done();
//})
//})
//it('makes the HTTP request', function() {
//request.isDone();
//});
//it('return a json array',function() {
//error.should.be.a('object');
//});
//});
//describe('with status code 404',function() {
//beforeEach(function(done) {
//request = nock('http://api.lelylan.com').get('/devices/1').replyWithFile(404, __dirname + '/fixtures/errors/404.json');
//done();
//})
//beforeEach(function(done) {
//Lelylan.Device.find('1', function(e, r) {
//error = e; response = r; done();
//})
//})
//it('makes the HTTP request', function() {
//request.isDone();
//});
//it('return a json array',function() {
//error.should.be.a('object');
//});
//});
//describe('with status code 422',function() {
//beforeEach(function(done) {
//request = nock('http://api.lelylan.com').get('/devices/1').replyWithFile(422, __dirname + '/fixtures/errors/422.json');
//done();
//})
//beforeEach(function(done) {
//Lelylan.Device.find('1', function(e, r) {
//error = e; response = r; done();
//})
//})
//it('makes the HTTP request', function() {
//request.isDone();
//});
//it('return a json array',function() {
//error.should.be.a('object');
//});
//});
//})