chore(putout) declare-undefined-variables: add custom declaration of stopAll

This commit is contained in:
coderaiser 2021-12-04 21:11:52 +02:00
parent 8097d96c72
commit 21e9736c81
2 changed files with 13 additions and 3 deletions

View file

@ -1,4 +1,11 @@
{
"rules": {
"declare-undefined-variables": ["on", {
"declarations": {
"stopAll": "const {stopAll} = mockRequire"
}
}]
},
"ignore": [
"html",
"fixture*",

View file

@ -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();
});