From 07c5f2008eb3540e7ab4525f9ae06d33f167904d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 4 Jun 2014 19:00:16 -0700 Subject: add basic sanity check tests --- test/basic.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/basic.js b/test/basic.js index cf79627..dc6ac75 100644 --- a/test/basic.js +++ b/test/basic.js @@ -1,6 +1,25 @@ +var cp = require('child_process') var test = require('tape') +var WebTorrent = require('../') -test('TODO', function (t) { - t.ok(true) - t.end() -}) \ No newline at end of file +/** + * Extensive bittorrent functionality tests are contained within dependencies like + * `bittorrent-client`, `bitorrent-protocol`, etc. + */ + +test('Module usage (sanity check)', function (t) { + var client = new WebTorrent() + t.equal(typeof client.add, 'function', 'client.add exists') + client.destroy(function () { + t.pass('client.destroy works') + t.end() + }) +}) + +test('Command line usage (sanity check)', function (t) { + var bin = __dirname + '/../bin/cmd.js' + cp.exec(bin, function (err, code) { + t.error(err) // no error, exit code 0 + t.end() + }) +}) -- cgit v1.2.3