mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore(putout) declare-undefined-variables: add custom declaration of stopAll
This commit is contained in:
parent
8097d96c72
commit
21e9736c81
2 changed files with 13 additions and 3 deletions
|
|
@ -1,4 +1,11 @@
|
|||
{
|
||||
"rules": {
|
||||
"declare-undefined-variables": ["on", {
|
||||
"declarations": {
|
||||
"stopAll": "const {stopAll} = mockRequire"
|
||||
}
|
||||
}]
|
||||
},
|
||||
"ignore": [
|
||||
"html",
|
||||
"fixture*",
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue