-
Notifications
You must be signed in to change notification settings - Fork 6
Description
DESCRIPTION
Detected awaiting a value that is not a "Thenable" (an object which has a then method, such as a Promise).
While it is valid JavaScript to await a non-Promise-like value (it will resolve immediately), this pattern is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise.
BAD PRACTICE
await 'value';
const createValue = () => 'value';
await createValue();
RECOMMENDED
await Promise.resolve('value');
const createValue = async () => 'value';
await createValue();
Look here: Unexpected await of a non-Promise (non-"Thenable") value
src/implementations/deterministic/mnemonic-phrase.spec.ts
});
it('creates mnemonic correctly', async () => {
const mnemonic = await MnemonicPhrase.create();
return expect(mnemonic.mnemonicPhrase).toEqual(fMnemonicPhrase);
});
Give star and donate for my work :)