-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #5 - choose a testing framework
- Loading branch information
Showing
5 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
// it("should respond with hello world", function(done) { | ||
// request("http://localhost:3000/hello", function(error, response, body){ | ||
// expect(body).toEqual("hello world"); | ||
// done(); | ||
// }); | ||
// }); | ||
|
||
describe('jasmine-node', function(){ | ||
|
||
it('should pass', function(){ | ||
expect(1+2).toEqual(3); | ||
}); | ||
|
||
it('shows asynchronous test', function(){ | ||
setTimeout(function(){ | ||
expect('second').toEqual('second'); | ||
asyncSpecDone(); | ||
}, 1); | ||
expect('first').toEqual('first'); | ||
asyncSpecWait(); | ||
}); | ||
|
||
it('shows asynchronous test node-style', function(done){ | ||
setTimeout(function(){ | ||
expect('second').toEqual('second'); | ||
// If you call done() with an argument, it will fail the spec | ||
// so you can use it as a handler for many async node calls | ||
done(); | ||
}, 1); | ||
expect('first').toEqual('first'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
// it("should respond with hello world", function(done) { | ||
// request("http://localhost:3000/hello", function(error, response, body){ | ||
// expect(body).toEqual("hello world"); | ||
// done(); | ||
// }); | ||
// }); | ||
|
||
var request = require('http'), | ||
url = 'http://localhost:1337/'; | ||
|
||
describe('webservice', function() { | ||
|
||
it('should respond to /ping', function(done) { | ||
console.log('x'); | ||
request.get(url + 'ping', function(res) { | ||
// console.log(res.statusCode); | ||
console.log(res); | ||
expect(res.statusCode).toBe(200); | ||
done(); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
request = require('http') | ||
|
||
url = 'http://localhost:1337/' | ||
|
||
describe 'jasmine-node', -> | ||
|
||
it 'should pass', -> | ||
console.log('testing from coffee') | ||
expect(1+2).toEqual(4) | ||
|
||
describe 'webservice', -> | ||
|
||
it 'should respond to /ping', (done) -> | ||
request.get url + 'ping', (res) -> | ||
expect res.statusCode toBe 200 | ||
done() | ||
|