NodeJS gives me a warning
(node: 32600) [DEP0013] Deprecated warning: calling an asynchronous function without a callback is deprecated.
when i run this test:
describe('whatever', () => {
it('test simple', async () => {
const dir = './build/fileTests';
if (fs.existsSync(dir)) {
console.log(`deleting ${dir}`);
await fs.rmdir(dir);
}
});
});
Well, I would almost agree that using asynchronous functions without a callback is bad (since only inside cb you can know exactly what happened, go on, etc.
... if it were not for my intentional use of ES7 async
/await
, because they do it synchronously, so I can work with what I get ... (in this special case, I could avoid rmdirSync , but that's not my point. ..)
so my question is: how can I get rid of such warnings?
- , async/await...
- , const r = ...
...