Why does chai isBelow doesn't want to take the string?

There is a test in which you need to check for example the string "test" > "rest". For this chai, assert is a function isBelow.
link to the full documentation
it is written that takes mixed. means must accept a string.
but when I insert line displays a screenshot of the error
written what was expected or the number or the date.
Can someone faced with such.
June 8th 19 at 17:30
3 answers
June 8th 19 at 17:32
Mixed is some wet fantasy authors chai — this type is not in the JS or even TS or Flow. If separately down to the docks does not indicate that it is for example Mixed number | string, you just have to look in the source code and try to use to understand what was being implied. Apparently meant "anything, different every time", very useful documentation:)

Judging by the code — only accepts Data and number.

How not to suffer: expect('test' > 'rest').to.be.true;. It seems counter-intuitive, but in fact, such tests are easier to read and maintain.
June 8th 19 at 17:34
string not checked. isBelow() is the comparison of numbers, use
assert.equal('123', '4564', 'not equal')
June 8th 19 at 17:36
mixed means more than one type, in this case the two - number and date.
Based on the documentation isBelow checks for the condition "first less than second". How are you going to compare strings?
I asked about mixed. I was advised to ask a new question
here's a question about mixed toaster
And how then to advance from the documentation to know which types can be transferred?(maybe I this question new ask on the toaster)))) because JSDoc mixed I saw. - karley.Abshi commented on June 8th 19 at 17:39
No, mixed means that means mixed. That is, it can be either a number or date or string, or any other type. Function isBelow takes two mandatory parameters of type mixed. Not surprisingly, the result has caused the author of neutopenia. And there is nothing strange in comparing strings. Sorting an array of strings and work - if 'foo' more 'bar' then 'bar' is the first. But the sorting, and what the author wants, is unclear.

it seems that in the dock a simple mistake. Please create an issue on github or make a pull request. Perhaps there is another function that suits you. But most likely, your problem can be solved somehow differently. - leanne.Robel commented on June 8th 19 at 17:42
usually the restrictions, if any, are described in the documentation. Otherwise just at random. In the case of chai, there are examples of tests there are used the possible data types chaijs.com/api/test - casimer.Marquardt80 commented on June 8th 19 at 17:45
why sorting? I just want to check the function isBelow two lines. test and rest. That gave me the api to do this test. Written supposedly mixed, so I can push the options line. - karley.Abshi commented on June 8th 19 at 17:48
can but I can't. Written one, in fact more. - leanne.Robel commented on June 8th 19 at 17:51
I do not see that I wrote about sorting. String in the native js you can compare of course. I said what about mixed and that the parameter can take. Yes, the rows and you can sort and compare, and concatenate, and perform other operations. - karley.Abshi commented on June 8th 19 at 17:54
okay, thank you. Will look like above overthrew the Pro test - karley.Abshi commented on June 8th 19 at 17:57

Find more questions by tags JavaScript