Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-06-05 06:00:16 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-06-05 06:00:16 +0400
commit07c5f2008eb3540e7ab4525f9ae06d33f167904d (patch)
tree745486dc58bee8301b3d2e55076b42c2e0665f62 /test/basic.js
parentaadfbe7276641294df18c4371d5b9cced2bb905e (diff)
add basic sanity check tests
Diffstat (limited to 'test/basic.js')
-rw-r--r--test/basic.js27
1 files changed, 23 insertions, 4 deletions
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()
+ })
+})