question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expect('123').toBeNumericString();

See original GitHub issue
expect('123').toBeNumericString();
expect('1,234,567.00').toBeNumericString();
expect('   123  ').not.toBeNumericString();
expect('1..0').not.toBeNumericString();

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jacobwardiocommented, Jan 30, 2017

No problem, I understand it’s not the most reliable thing that can be tested for.

0reactions
JamieMasoncommented, Jan 30, 2017

Sorry about this @jacobwarduk but similar to https://github.com/JamieMason/Jasmine-Matchers/issues/38#issuecomment-274784848, I’ve decided not to include this matcher (even though I created the issue in the first place).

Knowing more about it now, I worry there could be too many edge cases and because people depend on this library for their tests, I want it to be totally dependable so people can have confidence in it and their tests. This matcher might be a little risky.

Thanks a lot for your work on this Jacob, sorry to have wasted your time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test if object, array or string. · Issue #3457 · facebook/jest
Is there a way to check if a component is an object, array or string? This would be similar to chai's 'should.be.a' Ex.:...
Read more >
Test for numeric elements in a character string - Stack Overflow
numeric() from package varhandle. The function accepts the following arguments: v The character vector or factor vector. (Mandatory). na.rm ...
Read more >
Namespace: matchers - Jasmine Documentation
expect the actual value to be greater than or equal to the expected value. Parameters: Name, Type, Description. expected, Number. The expected value...
Read more >
Type Conversions - The Modern JavaScript Tutorial
Explicit conversion is usually required when we read a value from a string-based source like a text form but expect a number to...
Read more >
parseInt() - JavaScript - MDN Web Docs
The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found