FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mathjs/test/utils/types.test.js at master · JavaScriptIOT/mathjs · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
JavaScriptIOT
/
mathjs
Public
forked from
josdejong/mathjs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
mathjs
/
test
/
utils
/
types.test.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (44 loc) · 1.67 KB
Breadcrumbs
mathjs
/
test
/
utils
/
types.test.js
Copy path
File metadata and controls
57 lines (44 loc) · 1.67 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// test types utils
var
assert
=
require
(
'assert'
)
,
approx
=
require
(
'../../tools/approx'
)
,
types
=
require
(
'../../lib/utils/types'
)
;
describe
(
'types'
,
function
(
)
{
it
(
'should return the type of null'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
null
)
,
'null'
)
;
}
)
;
it
(
'should return the type of undefined'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
undefined
)
,
'undefined'
)
;
assert
.
equal
(
types
.
type
(
)
,
'undefined'
)
;
}
)
;
it
(
'should return the type of a boolean'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
false
)
,
'boolean'
)
;
assert
.
equal
(
types
.
type
(
true
)
,
'boolean'
)
;
}
)
;
it
(
'should return the type of a number'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
2.3
)
,
'number'
)
;
assert
.
equal
(
types
.
type
(
Number
(
2.3
)
)
,
'number'
)
;
assert
.
equal
(
types
.
type
(
new
Number
(
2.3
)
)
,
'number'
)
;
assert
.
equal
(
types
.
type
(
NaN
)
,
'number'
)
;
}
)
;
it
(
'should return the type of a string'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
'bla'
)
,
'string'
)
;
assert
.
equal
(
types
.
type
(
new
String
(
'bla'
)
)
,
'string'
)
;
}
)
;
it
(
'should return the type of an object'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
{
}
)
,
'Object'
)
;
assert
.
equal
(
types
.
type
(
new
Object
(
)
)
,
'Object'
)
;
}
)
;
it
(
'should return the type of an array'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
[
]
)
,
'Array'
)
;
assert
.
equal
(
types
.
type
(
new
Array
(
)
)
,
'Array'
)
;
}
)
;
it
(
'should return the type of a function'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
function
(
)
{
}
)
,
'Function'
)
;
}
)
;
it
(
'should return the type of a date'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
new
Date
(
)
)
,
'Date'
)
;
}
)
;
it
(
'should return the type of a regexp'
,
function
(
)
{
assert
.
equal
(
types
.
type
(
/
r
e
g
e
x
p
/
)
,
'RegExp'
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL