Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Added simple http test as an example

Tj Holowaychuk6143d08e2645
diff --git a/test/unit/http.js b/test/unit/http.js
new file mode 100644
index 00000000..14ddd4f5
--- /dev/null
+++ b/test/unit/http.js
@@ -0,0 +1,17 @@
+
+var http = require('http');
+
+var server = http.createServer(function(req, res){
+ res.end('Hello World\n');
+})
+
+server.listen(8888);
+
+describe('http', function(){
+ it('should provide an example', function(done){
+ http.get({ path: '/', port: 8888 }, function(res){
+ res.statusCode.should.equal(200);
+ done();
+ })
+ })
+})
\ No newline at end of file