From 806a83aaef5ad924d0d9dc7d31939f2debab5906 Mon Sep 17 00:00:00 2001 From: ryanscottaudio Date: Mon, 17 Apr 2017 13:58:11 -0400 Subject: [PATCH] Fix tests --- package.json | 5 +++-- test/embed-code-parse-test.js | 16 ++++++++-------- test/hyperscript-compability-test.js | 2 +- test/tape-wrapper.js | 13 ++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 9237640..4ac1d81 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "lint": "semistandard | snazzy", "test:node": "nyc babel-tape-runner test/*-test.js", - "test:browser": "browserify -t babelify -t brfs -d test/*-test.js | tape-run | faucet", + "test:browser": "browserify -t babelify -t brfs -d test/*-test.js | devtool -c -h --bf --no-nt | faucet", "test": "npm run test:node && npm run test:browser && npm run lint", "build": "rm -rf dist && mkdir -p dist && babel lib --out-dir dist", "watch": "rm -rf dist && mkdir -p dist && babel lib --out-dir dist --watch", @@ -35,14 +35,15 @@ "babelify": "^7.2.0", "brfs": "^1.4.3", "browserify": "^13.0.0", + "devtool": "^2.3.1", "faucet": "0.0.1", "hyperscript": "^1.4.7", "nyc": "^8.3.0", "query-dom": "^3.0.7", "semistandard-deku": "micnews/semistandard#deku", "snazzy": "^5.0.0", + "tapava": "^2.3.0", "tape-catch": "^1.0.4", - "tape-run": "^2.1.4", "tsml": "^1.0.1" }, "dependencies": { diff --git a/test/embed-code-parse-test.js b/test/embed-code-parse-test.js index c1819d1..43656ce 100644 --- a/test/embed-code-parse-test.js +++ b/test/embed-code-parse-test.js @@ -178,7 +178,7 @@ test('facebook', t => { expectedVideo ); - t.equals( + t.is( renderAndParse(expectedVideo).url, expectedVideo.url ); @@ -206,7 +206,7 @@ test('facebook', t => { ); t.deepEqual(parseInput('//facebook.com/zuck/posts/10102593740125791'), expectedPost); - t.equals( + t.is( renderAndParse(expectedPost).url, expectedPost.url ); @@ -239,7 +239,7 @@ test('facebook', t => { parseInput('//facebook.com/rewire.news/photos/a.102749171737.90216.9432926737/10152515593211738'), expectedPagePhoto); - t.equals( + t.is( renderAndParse(expectedPagePhoto).url, expectedPagePhoto.url ); @@ -264,7 +264,7 @@ test('facebook', t => { parseInput('https://www.facebook.com/photo.php?fbid=10103183415950711&set=pcb.10103183428221121&type=3&theater'), expectedPhoto); - t.equals( + t.is( renderAndParse(expectedPhoto).url, expectedPhoto.url ); @@ -300,7 +300,7 @@ test('youtube', t => { t.deepEqual(parseInput('http://youtu.be/I7IdS-PbEgI'), expected); t.deepEqual(parseInput('//youtu.be/I7IdS-PbEgI'), expected); - t.equals( + t.is( renderAndParse(expected).youtubeId, expected.youtubeId ); @@ -355,7 +355,7 @@ test('twitter', t => { expected ); - t.equals( + t.is( renderAndParse(expected).url, expected.url ); @@ -392,7 +392,7 @@ test('tumblr', t => { expected ); - t.equals( + t.is( renderAndParse(expected).url, expected.url ); @@ -572,7 +572,7 @@ test('scribd', t => { url: 'https://www.scribd.com/embeds/320741042/content' }; - t.deepEqual(parseInput(scribdCode), expectedDocument); + t.deepEqual(parseInput(scribdCodeDocument), expectedDocument); t.deepEqual(parseInput('https://www.scribd.com/document/320741042/Mike-Crapo-Missing-Poster-2-10-2017'), expected); }); diff --git a/test/hyperscript-compability-test.js b/test/hyperscript-compability-test.js index 6af00ea..1000622 100644 --- a/test/hyperscript-compability-test.js +++ b/test/hyperscript-compability-test.js @@ -1,7 +1,7 @@ import test from './tape-wrapper'; test('hyperscript + embeds compability', t => { - t.doesNotThrow(function () { + t.notThrows(function () { require('hyperscript'); require('./../lib'); }); diff --git a/test/tape-wrapper.js b/test/tape-wrapper.js index c28ff9d..72085e7 100644 --- a/test/tape-wrapper.js +++ b/test/tape-wrapper.js @@ -1,8 +1,7 @@ -import test from 'tape-catch'; +import test from 'tapava'; -export default (msg, cb) => { - test(msg, (t) => { - cb(t); - t.end(); - }); -}; +if (process.browser) { + test.onFinish(global.close); +} + +export default test;