isString.spec.js 634 B

1234567891011121314151617181920212223242526
  1. /* Import modules. */
  2. const Nito = require('../..')
  3. describe('Utils:isString', () => {
  4. test('it should test a valid string', async () => {
  5. /* Set string. */
  6. const str = 'Hello Bitcoin!'
  7. /* Encode value. */
  8. const isString = Nito.Utils.isString(str)
  9. /* Evaluate test. */
  10. expect(isString).toBeTruthy()
  11. })
  12. test('it should test a invalid string', async () => {
  13. /* Set (non-) string. */
  14. const str = 1337
  15. /* Encode value. */
  16. const isString = Nito.Utils.isString(str)
  17. /* Evaluate test. */
  18. expect(isString).toBeFalsy()
  19. })
  20. })