From 74d56f795d22e98937dce0641ee3c7514a79e9e6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sun, 13 Jan 2019 20:55:19 +0200 Subject: [PATCH] feature(package) tape -> supertape --- client/dom/current-file.spec.js | 2 +- client/dom/dom-tree.spec.js | 2 +- client/dom/events/event-store.spec.js | 2 +- client/key/vim/find.spec.js | 2 +- client/key/vim/index.spec.js | 2 +- client/modules/polyfill.spec.js | 2 +- client/sw/register.spec.js | 5 ++--- common/cloudfunc.spec.js | 2 +- common/datetime.spec.js | 2 +- package.json | 3 +-- server/cloudcmd.spec.js | 2 +- server/config.spec.js | 2 +- server/distribute/export.spec.js | 2 +- server/distribute/import.spec.js | 2 +- server/distribute/log.spec.js | 2 +- server/exit.spec.js | 2 +- server/markdown.spec.js | 2 +- server/rest/index.spec.js | 2 +- server/rest/info.spec.js | 2 +- server/root.spec.js | 2 +- server/route.spec.js | 3 +-- server/validate.spec.js | 2 +- test/client/listeners/get-index.js | 2 +- test/client/listeners/get-range.js | 2 +- test/client/modules/operation/remove-extension.js | 6 +++--- test/common/btoa.js | 2 +- test/common/cloudfunc.js | 2 +- test/common/entity.js | 2 +- test/common/util.js | 2 +- test/plugins.js | 2 +- test/rest/config.js | 2 +- test/rest/cp.js | 2 +- test/rest/fs.js | 3 +-- test/rest/mv.js | 3 +-- test/rest/pack.js | 3 +-- test/rest/rest.js | 2 +- test/server/columns.js | 2 +- test/server/console.js | 2 +- test/server/env.js | 2 +- test/server/modulas.js | 3 +-- test/server/prefixer.js | 2 +- test/server/show-config.js | 2 +- test/server/terminal.js | 2 +- test/static.js | 3 +-- 44 files changed, 47 insertions(+), 55 deletions(-) diff --git a/client/dom/current-file.spec.js b/client/dom/current-file.spec.js index 79cde62bc8..8153795016 100644 --- a/client/dom/current-file.spec.js +++ b/client/dom/current-file.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const {create} = require('auto-globals'); const stub = require('@cloudcmd/stub'); const id = (a) => a; diff --git a/client/dom/dom-tree.spec.js b/client/dom/dom-tree.spec.js index 499307049c..2a9c767b9a 100644 --- a/client/dom/dom-tree.spec.js +++ b/client/dom/dom-tree.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const {create} = require('auto-globals'); const tryCatch = require('try-catch'); diff --git a/client/dom/events/event-store.spec.js b/client/dom/events/event-store.spec.js index 0f1761d621..0ff1b5bf9e 100644 --- a/client/dom/events/event-store.spec.js +++ b/client/dom/events/event-store.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const eventStore = require('./event-store'); test('event-store: get', (t) => { diff --git a/client/key/vim/find.spec.js b/client/key/vim/find.spec.js index 661434987a..24c84361d2 100644 --- a/client/key/vim/find.spec.js +++ b/client/key/vim/find.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const dir = './'; diff --git a/client/key/vim/index.spec.js b/client/key/vim/index.spec.js index ce2f8a7c04..099607d4b3 100644 --- a/client/key/vim/index.spec.js +++ b/client/key/vim/index.spec.js @@ -2,7 +2,7 @@ const {join} = require('path'); -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const mockRequire = require('mock-require'); const {reRequire} = mockRequire; diff --git a/client/modules/polyfill.spec.js b/client/modules/polyfill.spec.js index 482fc2873b..bbfb4653e0 100644 --- a/client/modules/polyfill.spec.js +++ b/client/modules/polyfill.spec.js @@ -1,6 +1,6 @@ 'use stric'; -const test = require('tape'); +const test = require('supertape'); const mockRequire = require('mock-require'); const stub = require('@cloudcmd/stub'); diff --git a/client/sw/register.spec.js b/client/sw/register.spec.js index 515a13429a..a4db0a0e11 100644 --- a/client/sw/register.spec.js +++ b/client/sw/register.spec.js @@ -1,10 +1,9 @@ 'use strict'; -const tryTo = require('try-to-tape'); const autoGlobals = require('auto-globals'); -const tape = require('tape'); +const tape = require('supertape'); -const test = autoGlobals(tryTo(tape)); +const test = autoGlobals(tape); const stub = require('@cloudcmd/stub'); const tryCatch = require('try-catch'); diff --git a/common/cloudfunc.spec.js b/common/cloudfunc.spec.js index e25d93d5b4..f04da04fbc 100644 --- a/common/cloudfunc.spec.js +++ b/common/cloudfunc.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const cloudfunc = require('./cloudfunc'); const { _getSize, diff --git a/common/datetime.spec.js b/common/datetime.spec.js index 96a72b4d79..da81f65e6d 100644 --- a/common/datetime.spec.js +++ b/common/datetime.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const datetime = require('./datetime'); test('common: datetime', (t) => { diff --git a/package.json b/package.json index 6d52b8c0c0..e5290d52b0 100644 --- a/package.json +++ b/package.json @@ -225,9 +225,8 @@ "stylelint": "^9.0.0", "stylelint-config-standard": "^18.0.0", "supermenu": "^2.1.2", - "tape": "^4.4.0", + "supertape": "^1.0.3", "tar-stream": "^1.5.2", - "try-to-tape": "^1.0.0", "unionfs": "^3.0.2", "url-loader": "^1.0.1", "version-io": "^2.0.1", diff --git a/server/cloudcmd.spec.js b/server/cloudcmd.spec.js index 9fe11dde6f..5bee6a70f4 100644 --- a/server/cloudcmd.spec.js +++ b/server/cloudcmd.spec.js @@ -2,7 +2,7 @@ const path = require('path'); -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const currify = require('currify'); const {reRequire} = require('mock-require'); diff --git a/server/config.spec.js b/server/config.spec.js index 533465670b..fb0a7abb5a 100644 --- a/server/config.spec.js +++ b/server/config.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const root = '../'; diff --git a/server/distribute/export.spec.js b/server/distribute/export.spec.js index 03b81a34e1..bd28872bf7 100644 --- a/server/distribute/export.spec.js +++ b/server/distribute/export.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const io = require('socket.io-client'); const {connect} = require('../../test/before'); diff --git a/server/distribute/import.spec.js b/server/distribute/import.spec.js index a7949a4468..be8d8c7ee8 100644 --- a/server/distribute/import.spec.js +++ b/server/distribute/import.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const {promisify} = require('util'); const tryToCatch = require('try-to-catch'); const {connect} = require('../../test/before'); diff --git a/server/distribute/log.spec.js b/server/distribute/log.spec.js index a576310696..91a01a13d5 100644 --- a/server/distribute/log.spec.js +++ b/server/distribute/log.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const log = require('./log'); const config = require('../config'); diff --git a/server/exit.spec.js b/server/exit.spec.js index 169c445e95..85ee3a94a6 100644 --- a/server/exit.spec.js +++ b/server/exit.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const exit = require('./exit'); const stub = require('@cloudcmd/stub'); diff --git a/server/markdown.spec.js b/server/markdown.spec.js index 96a379443a..b177c04499 100644 --- a/server/markdown.spec.js +++ b/server/markdown.spec.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); -const test = require('tape'); +const test = require('supertape'); const {promisify} = require('util'); const tryToCatch = require('try-to-catch'); diff --git a/server/rest/index.spec.js b/server/rest/index.spec.js index b47344aa23..e7059a62b0 100644 --- a/server/rest/index.spec.js +++ b/server/rest/index.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const rest = require('.'); const { _formatMsg, diff --git a/server/rest/info.spec.js b/server/rest/info.spec.js index 5a70e4bd60..a067cc6867 100644 --- a/server/rest/info.spec.js +++ b/server/rest/info.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const info = require('./info'); const stub = require('@cloudcmd/stub'); diff --git a/server/root.spec.js b/server/root.spec.js index 72dc97ec25..28b02b25b6 100644 --- a/server/root.spec.js +++ b/server/root.spec.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const mockRequire = require('mock-require'); const {reRequire} = mockRequire; diff --git a/server/route.spec.js b/server/route.spec.js index 4bd23fea41..8e21118bd2 100644 --- a/server/route.spec.js +++ b/server/route.spec.js @@ -4,8 +4,7 @@ const path = require('path'); const fs = require('fs'); const tryToCatch = require('try-to-catch'); -const tryToTape = require('try-to-tape'); -const test = tryToTape(require('tape')); +const test = require('supertape'); const mockRequire = require('mock-require'); const {reRequire} = mockRequire; diff --git a/server/validate.spec.js b/server/validate.spec.js index 2cdc091848..dd28c111f4 100644 --- a/server/validate.spec.js +++ b/server/validate.spec.js @@ -2,7 +2,7 @@ const fs = require('fs'); -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const tryCatch = require('try-catch'); const mockRequire = require('mock-require'); diff --git a/test/client/listeners/get-index.js b/test/client/listeners/get-index.js index 16dd69990a..0f13acd6af 100644 --- a/test/client/listeners/get-index.js +++ b/test/client/listeners/get-index.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const dir = '../../../client/listeners'; const getIndex = require(`${dir}/get-index`); diff --git a/test/client/listeners/get-range.js b/test/client/listeners/get-range.js index 9b431de0b1..80816ecac7 100644 --- a/test/client/listeners/get-range.js +++ b/test/client/listeners/get-range.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const dir = '../../../client/listeners'; const getRange = require(`${dir}/get-range`); diff --git a/test/client/modules/operation/remove-extension.js b/test/client/modules/operation/remove-extension.js index 6491f052d7..de111ebecd 100644 --- a/test/client/modules/operation/remove-extension.js +++ b/test/client/modules/operation/remove-extension.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const dir = '../../../../client/modules/operation'; const removeExtension = require(`${dir}/remove-extension`); @@ -16,7 +16,7 @@ test('cloudcmd: client: modules: operation: removeExtension: .tar.gz', (t) => { test('cloudcmd: client: modules: operation: removeExtension: .tar.bz2', (t) => { const name = 'hello'; const fullName = `${name}.tar.bz2`; - + t.equal(removeExtension(fullName), name, 'should remove .tar.bz2'); t.end(); }); @@ -24,7 +24,7 @@ test('cloudcmd: client: modules: operation: removeExtension: .tar.bz2', (t) => { test('cloudcmd: client: modules: operation: removeExtension: .bz2', (t) => { const name = 'hello'; const fullName = `${name}.bz2`; - + t.equal(removeExtension(fullName), name, 'should remove .bz2'); t.end(); }); diff --git a/test/common/btoa.js b/test/common/btoa.js index a18e89472d..9a82d5e47a 100644 --- a/test/common/btoa.js +++ b/test/common/btoa.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const btoa = require('../../common/btoa'); diff --git a/test/common/cloudfunc.js b/test/common/cloudfunc.js index 79eae79d46..ee28e53b73 100644 --- a/test/common/cloudfunc.js +++ b/test/common/cloudfunc.js @@ -15,7 +15,7 @@ const CloudFuncPath = COMMONDIR + 'cloudfunc'; const CloudFunc = require(CloudFuncPath); -const test = require('tape'); +const test = require('supertape'); const {reRequire} = require('mock-require'); const htmlLooksLike = require('html-looks-like'); diff --git a/test/common/entity.js b/test/common/entity.js index 43b54d487f..8e38f46ab0 100644 --- a/test/common/entity.js +++ b/test/common/entity.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const entity = require('../../common/entity'); test('cloudcmd: entity: encode', (t) => { diff --git a/test/common/util.js b/test/common/util.js index 52d6a664b6..f56bad4c2d 100644 --- a/test/common/util.js +++ b/test/common/util.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const {reRequire} = require('mock-require'); const DIR = '../../'; const UtilPath = DIR + 'common/util'; diff --git a/test/plugins.js b/test/plugins.js index 4c1b4eb525..10fae87728 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -1,7 +1,7 @@ 'use strict'; const fs = require('fs'); -const test = require('tape'); +const test = require('supertape'); const cloudcmd = require('..'); const config = { diff --git a/test/rest/config.js b/test/rest/config.js index 0d161e64e2..5ee2f0cadd 100644 --- a/test/rest/config.js +++ b/test/rest/config.js @@ -3,7 +3,7 @@ const path = require('path'); const os = require('os'); -const test = require('tape'); +const test = require('supertape'); const readjson = require('readjson'); const writejson = require('writejson'); diff --git a/test/rest/cp.js b/test/rest/cp.js index a409ee55c8..1dd83f25b5 100644 --- a/test/rest/cp.js +++ b/test/rest/cp.js @@ -2,7 +2,7 @@ const {mkdirSync} = require('fs'); const {join} = require('path'); -const test = require('tape'); +const test = require('supertape'); const rimraf = require('rimraf'); const fixtureDir = join(__dirname, '..', 'fixture') + '/'; diff --git a/test/rest/fs.js b/test/rest/fs.js index c8010c49ce..94ab1ed292 100644 --- a/test/rest/fs.js +++ b/test/rest/fs.js @@ -1,7 +1,6 @@ 'use strict'; -const tryToTape = require('try-to-tape'); -const test = tryToTape(require('tape')); +const test = require('supertape'); const cloudcmd = require('../..'); const {request} = require('serve-once')(cloudcmd); diff --git a/test/rest/mv.js b/test/rest/mv.js index 8ee9b24cad..a5475bfd32 100644 --- a/test/rest/mv.js +++ b/test/rest/mv.js @@ -2,8 +2,7 @@ const fs = require('fs'); -const tryToTape = require('try-to-tape'); -const test = tryToTape(require('tape')); +const test = require('supertape'); const {Volume} = require('memfs'); const {ufs} = require('unionfs'); diff --git a/test/rest/pack.js b/test/rest/pack.js index 915bd44134..23e44bfd47 100644 --- a/test/rest/pack.js +++ b/test/rest/pack.js @@ -5,8 +5,7 @@ const {join} = require('path'); const {promisify} = require('util'); const {reRequire} = require('mock-require'); -const tryToTape = require('try-to-tape'); -const test = tryToTape(require('tape')); +const test = require('supertape'); const tar = require('tar-stream'); const gunzip = require('gunzip-maybe'); const pullout = require('pullout'); diff --git a/test/rest/rest.js b/test/rest/rest.js index 947bbb64cf..70da208ad4 100644 --- a/test/rest/rest.js +++ b/test/rest/rest.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const rest = require('../../server/rest'); const { diff --git a/test/server/columns.js b/test/server/columns.js index 9869b23943..9ccb0e6636 100644 --- a/test/server/columns.js +++ b/test/server/columns.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const fs = require('fs'); const {reRequire} = require('mock-require'); const columnsPath = '../../server/columns'; diff --git a/test/server/console.js b/test/server/console.js index 858bdd89a8..689665b418 100644 --- a/test/server/console.js +++ b/test/server/console.js @@ -2,7 +2,7 @@ const path = require('path'); -const test = require('tape'); +const test = require('supertape'); const io = require('socket.io-client'); const configPath = path.join(__dirname, '../..', 'server', 'config'); diff --git a/test/server/env.js b/test/server/env.js index 7d0fad6e6f..2357ef6329 100644 --- a/test/server/env.js +++ b/test/server/env.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const env = require('../../server/env'); test('env: small', (t) => { diff --git a/test/server/modulas.js b/test/server/modulas.js index afafc2b9a1..df29007f85 100644 --- a/test/server/modulas.js +++ b/test/server/modulas.js @@ -1,8 +1,7 @@ 'use strict'; const {join} = require('path'); -const tryTo = require('try-to-tape'); -const test = tryTo(require('tape')); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const dir = join(__dirname, '..', '..'); diff --git a/test/server/prefixer.js b/test/server/prefixer.js index a7c7e824f8..a0cdfcd786 100644 --- a/test/server/prefixer.js +++ b/test/server/prefixer.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const dir = '../../server/'; const prefixer = require(dir + 'prefixer'); diff --git a/test/server/show-config.js b/test/server/show-config.js index d2d597dbbb..cea3a805c4 100644 --- a/test/server/show-config.js +++ b/test/server/show-config.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const showConfig = require('../../server/show-config'); test('cloudcmd: show-config: no arguments', (t) => { diff --git a/test/server/terminal.js b/test/server/terminal.js index b47a46c99b..de1b607d2e 100644 --- a/test/server/terminal.js +++ b/test/server/terminal.js @@ -1,6 +1,6 @@ 'use strict'; -const test = require('tape'); +const test = require('supertape'); const stub = require('@cloudcmd/stub'); const mockRequire = require('mock-require'); diff --git a/test/static.js b/test/static.js index ed75ffe67f..c02d92207f 100644 --- a/test/static.js +++ b/test/static.js @@ -1,7 +1,6 @@ 'use strict'; -const tryTo = require('try-to-tape'); -const test = tryTo(require('tape')); +const test = require('supertape'); const criton = require('criton'); const cloudcmd = require('..');