Files
common/packages/util-crypto/src/mnemonic/validate.spec.ts
T
Jaco Greeff 80db504a3b Swap to using eslint (#435)
* WIP

* ... and more

* yet more...

* and examples (more-or-less) fixed

* Only problematic promisify left...

* Last batch

* rm config header

* Update

* Use Record

* Bumps
2019-07-14 11:12:46 +02:00

25 lines
747 B
TypeScript

// Copyright 2017-2019 @polkadot/util-crypto authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import validate from './validate';
import { cryptoWaitReady } from '..';
describe('mnemonicValidate', (): void => {
beforeEach(async (): Promise<void> => {
await cryptoWaitReady();
});
it('returns true on valid', (): void => {
expect(
validate('seed sock milk update focus rotate barely fade car face mechanic mercy')
).toEqual(true);
});
it('returns false on invalid', (): void => {
expect(
validate('wine photo extra cushion basket dwarf humor cloud truck job boat submit')
).toEqual(false);
});
});