Skip to content

Commit c056af0

Browse files
jhermsmeierMark Schmalealxhotel
authored
test: Add Browserify tests (#66)
* Update package.json: Add browserify dev dep & scripts * Remove Makefile * Add test/index.html * Update browserify --------- Co-authored-by: Mark Schmale <[email protected]> Co-authored-by: Alex <[email protected]>
1 parent 1190cd8 commit c056af0

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

Makefile

Lines changed: 0 additions & 21 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@webtorrent/semantic-release-config": "1.0.9",
2323
"bencoding": "latest",
2424
"bncode": "latest",
25+
"browserify": "^17.0.0",
2526
"btparse": "latest",
2627
"dht-bencode": "latest",
2728
"dht.js": "latest",
@@ -51,6 +52,9 @@
5152
},
5253
"scripts": {
5354
"benchmark": "nanobench benchmark/*.js",
55+
"bundle": "mkdir -p dist && npm run bundle:lib && npm run bundle:test",
56+
"bundle:lib": "browserify lib/index.js -s bencode -o dist/bencode.js",
57+
"bundle:test": "browserify test/*.test.js -o dist/tests.js",
5458
"style": "standard --fix",
5559
"test": "standard && tape test/*.test.js | tap-spec"
5660
},

test/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Bencode</title>
5+
</head>
6+
<body>
7+
<script src='/dist/tests.js'></script>
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)