diff --git a/.putout.json b/.putout.json index cbb9353c..9eb3904a 100644 --- a/.putout.json +++ b/.putout.json @@ -6,6 +6,9 @@ "fontello.json" ], "match": { + "route.spec.js": { + "tape/convert-ok-to-match": "off" + }, "*.js": { "convert-esm-to-commonjs": "on" }, diff --git a/server/fixture-user-menu/io-cp-fix.js b/server/fixture-user-menu/io-cp-fix.js index 8ce51b3b..a8d5279f 100644 --- a/server/fixture-user-menu/io-cp-fix.js +++ b/server/fixture-user-menu/io-cp-fix.js @@ -1,2 +1,4 @@ 'use strict'; -await IO.copy(dirPath, mp3Dir, mp3Names); +async function copy() { + await IO.copy(dirPath, mp3Dir, mp3Names); +} diff --git a/server/fixture-user-menu/io-cp.js b/server/fixture-user-menu/io-cp.js index 5b3e0fa4..0547933c 100644 --- a/server/fixture-user-menu/io-cp.js +++ b/server/fixture-user-menu/io-cp.js @@ -1,5 +1,7 @@ -await IO.cp({ - from: dirPath, - to: mp3Dir, - names: mp3Names, -}); +async function copy() { + await IO.cp({ + from: dirPath, + to: mp3Dir, + names: mp3Names, + }); +} diff --git a/server/fixture-user-menu/io-mv-fix.js b/server/fixture-user-menu/io-mv-fix.js index c56998a8..5c66858a 100644 --- a/server/fixture-user-menu/io-mv-fix.js +++ b/server/fixture-user-menu/io-mv-fix.js @@ -1,2 +1,4 @@ 'use strict'; -await IO.move(dirPath, mp3Dir, mp3Names); +async function move() { + await IO.move(dirPath, mp3Dir, mp3Names); +} diff --git a/server/fixture-user-menu/io-mv.js b/server/fixture-user-menu/io-mv.js index 8d11ed43..56884891 100644 --- a/server/fixture-user-menu/io-mv.js +++ b/server/fixture-user-menu/io-mv.js @@ -1,5 +1,7 @@ -await IO.mv({ - from: dirPath, - to: mp3Dir, - names: mp3Names, -}); +async function move() { + await IO.mv({ + from: dirPath, + to: mp3Dir, + names: mp3Names, + }); +} diff --git a/server/markdown/index.spec.js b/server/markdown/index.spec.js index 38637bf8..60fff869 100644 --- a/server/markdown/index.spec.js +++ b/server/markdown/index.spec.js @@ -71,7 +71,7 @@ test('cloudcmd: markdown: put: error', async (t) => { const [e] = await tryToCatch(_markdown, name, '/', mdStream); - t.ok(e.message.includes('ENOENT: no such file or directory'), 'should emit error'); + t.match(e.message, /ENOENT: no such file or directory/, 'should emit error'); t.end(); }); diff --git a/server/route.spec.js b/server/route.spec.js index 556da03b..10f67b7e 100644 --- a/server/route.spec.js +++ b/server/route.spec.js @@ -221,7 +221,7 @@ test('cloudcmd: route: not found', async (t) => { options, }); - t.ok(body.includes('ENOENT: no such file or directory'), 'should return error'); + t.match(body, /ENOENT: no such file or directory/, 'should return error'); t.end(); }); diff --git a/server/terminal.spec.js b/server/terminal.spec.js index 259d3aaf..863f4b48 100644 --- a/server/terminal.spec.js +++ b/server/terminal.spec.js @@ -58,7 +58,7 @@ test('cloudcmd: terminal: enabled: no string', (t) => { const msg = 'cloudcmd --terminal: Cannot find module \'hello\''; const [arg] = log.args[0]; - t.ok(arg.includes(msg), 'should call with msg'); + t.match(arg, RegExp(msg), 'should call with msg'); t.end(); });