diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-09-21 05:41:24 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-09-21 05:41:24 +0400 |
commit | 93686505fbc90522c75b6c151ec7261aa76098de (patch) | |
tree | 5b474b920e79b7b39b6804fac5e6a641de6ae843 /test/basic.js | |
parent | 2e14192c311f64c20496a72af7ffce36495be92b (diff) |
merge `bittorrent-client` into this module
When I started the WebTorrent project I thought there were going to
need to be two separate client implementations (bittorrent-client and
webtorrent-client) that would get tied together in a higher-level
module.
Fortunately, this was not necessary because of the awesome “browser”
field support in browserify. By substituting just a few modules, we can
make the same module (webtorrent) work in node AND the browser, with
the same codebase!
So, from now on, you can just `require(‘webtorrent’)` in node or the
browser, and it will just work. You can also `npm install webtorrent`
if you want to use bittorrent in a node app or script. Lastly, you can
`npm install webtorrent -g` if you want to use webtorrent as a command
line app (it installs a `webtorrent` command).
Diffstat (limited to 'test/basic.js')
-rw-r--r-- | test/basic.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/test/basic.js b/test/basic.js deleted file mode 100644 index 0801452..0000000 --- a/test/basic.js +++ /dev/null @@ -1,44 +0,0 @@ -var cp = require('child_process') -var test = require('tape') -var WebTorrent = require('../') - -/** - * 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: --help', function (t) { - t.plan(2) - - var bin = __dirname + '/../bin/cmd.js --help' - cp.exec(bin, function (err, data) { - t.error(err) // no error, exit code 0 - t.ok(data.indexOf('usage') !== 0) - }) -}) - -test('Command line: -v --version', function (t) { - t.plan(4) - var expectedVersion = require(__dirname + '/../package.json').version + '\n' - - var bin = __dirname + '/../bin/cmd.js --version' - cp.exec(bin, function (err, data) { - t.error(err) // no error, exit code 0 - t.equal(data, expectedVersion) - }) - - bin = __dirname + '/../bin/cmd.js -v' - cp.exec(bin, function (err, data) { - t.error(err) // no error, exit code 0 - t.equal(data, expectedVersion) - }) -}) |