Skip to content

Commit

Permalink
Merge pull request #44 from FACN3/Fix_tests
Browse files Browse the repository at this point in the history
Fix the tests, now all tests are passing :)
  • Loading branch information
MynahMarie authored Nov 29, 2017
2 parents a9b2353 + 6740365 commit 0a2aaa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function handleStatic(request, response) {

//send an API request to other server
function handleRequest(request , response){
var parallel =0;
// var parallel =0;
let query = request.url.split('=')[1];
let weather_url = 'https://api.openweathermap.org/data/2.5/weather?q=' + query + '&appid=82e45ca76afa605e31bf2540d2afe634';

Expand Down
3 changes: 1 addition & 2 deletions tests/back-endTesting.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tape');
const shot = require('shot');
const router = require('../src/router.js');
const time_url = "https://api.xmltime.com/timeservice?accesskey=RZCuYAuoC3&expires=2017-11-29T10%3A55%3A01%2B00%3A00&signature=6w7yR8inwcK6e%2Fqur0fb5fKug5Y%3D&version=2&out=js&prettyprint=1&query=Oslo&geo=1&lang=en&time=1&sun=0&timechanges=0&tz=1&verbosetime=1"

//TESTING THE ROUTER
// Home Route
Expand All @@ -28,7 +27,7 @@ test('Testing the router for the static files', (t) => {
})

test('Testing the router for the time api', (t) => {
shot.inject(router, { method: 'get', url: time_url }, (res) => {
shot.inject(router, { method: 'get', url: "/submit?search=Amsterdam" }, (res) => {
t.equal(res.statusCode, 200, 'should respond with status code of 200 for the JSON data');
t.notEqual(res.payload,undefined, 'response should contain a JSON object');
})
Expand Down

0 comments on commit 0a2aaa6

Please sign in to comment.