diff --git a/.putout.json b/.putout.json index b7d0e6c8..e2d41123 100644 --- a/.putout.json +++ b/.putout.json @@ -1,4 +1,11 @@ { + "rules": { + "declare-undefined-variables": ["on", { + "declarations": { + "stopAll": "const {stopAll} = mockRequire" + } + }] + }, "ignore": [ "html", "fixture*", diff --git a/server/route.spec.js b/server/route.spec.js index d8cd91bb..8685132e 100644 --- a/server/route.spec.js +++ b/server/route.spec.js @@ -8,7 +8,10 @@ const fs = require('fs'); const tryToCatch = require('try-to-catch'); const {test, stub} = require('supertape'); const mockRequire = require('mock-require'); -const {reRequire, stopAll} = mockRequire; +const { + reRequire, + stopAll, +} = mockRequire; const fixtureDir = path.join(__dirname, '..', 'test', 'fixture'); @@ -481,14 +484,14 @@ test('cloudcmd: route: read: root', async (t) => { await request.get('/fs/route.js'); - stopAll(); - const expected = [ '/hello/route.js', { root, }, ]; + stopAll(); + t.calledWith(read, expected); t.end(); });