forked from routejs-66/routejs-66
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.js
78 lines (67 loc) · 2.16 KB
/
test.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
// var assert = require('assert');
var assert = require('chai').should();
// var request = require('request');
var axios = require('axios');
// test the test
describe('Test the Test', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
[1,2,3].indexOf(4).should.equal(-1);
});
});
});
describe('POST /api/geocode', function() {
it('responds with status 200', function(done) {
// Send a POST request
axios({
method: 'post',
url: 'http://localhost:7337/api/geocode',
data: {
search: 'latlng=40.7504644,-73.976815'
},
timeout: 10000,
responseType: 'application/json'
})
// axios.post('http://localhost:7337/api/geocode', {
// search: 'latlng=40.7504644,-73.976815'
// })
.then(function (response) {
// console.log('+++++=+=+=+', response.data, '++++++++++++');
response.status.should.equal(200);
return done();
})
.catch(function (error) {
throw new Error(error);
return done();
});
});
});
// describe('POST /api/geocode', function() {
// it('respond with json', function(done) {
// // let req = {body: {search: 'latlng=40.7504644,-73.976815'}};
// // request.post('http://service.com/upload', {form:{key:'value'}})
// request.post({url:'localhost:7337/api/geocode', body: {search: 'latlng=40.7504644,-73.976815'}}, function(err,httpResponse,body){
// console.log('+++++++++++++++', body, '+++++++++++++');
// console.log('+++++++++++++++', httpResponse, '+++++++++++++');
// done();
// })
// });
// });
// describe('Maps', function() {
// var $rootScope;
// var $location;
// beforeEach(function() {
// module('mapApp');
// inject(function(_mapCtrl_, _$rootScope_, _$location_) {
// $rootScope = _$rootScope_;
// $location = _$location_;
// });
// $location.path("/");
// });
// describe('mapRender', function() {
// it('should set mapRender to true when visiting /map', function() {
// $location.path("/map");
// $rootScope.mapRender.should.equal(true);
// });
// });
// });