source: trip-planner-front/node_modules/is-typedarray/test.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1var test = require('tape')
2var ista = require('./')
3
4test('strict', function(t) {
5 t.ok(ista.strict(new Int8Array), 'Int8Array')
6 t.ok(ista.strict(new Int16Array), 'Int16Array')
7 t.ok(ista.strict(new Int32Array), 'Int32Array')
8 t.ok(ista.strict(new Uint8Array), 'Uint8Array')
9 t.ok(ista.strict(new Uint16Array), 'Uint16Array')
10 t.ok(ista.strict(new Uint32Array), 'Uint32Array')
11 t.ok(ista.strict(new Float32Array), 'Float32Array')
12 t.ok(ista.strict(new Float64Array), 'Float64Array')
13
14 t.ok(!ista.strict(new Array), 'Array')
15 t.ok(!ista.strict([]), '[]')
16
17 t.end()
18})
19
20test('loose', function(t) {
21 t.ok(ista.loose(new Int8Array), 'Int8Array')
22 t.ok(ista.loose(new Int16Array), 'Int16Array')
23 t.ok(ista.loose(new Int32Array), 'Int32Array')
24 t.ok(ista.loose(new Uint8Array), 'Uint8Array')
25 t.ok(ista.loose(new Uint16Array), 'Uint16Array')
26 t.ok(ista.loose(new Uint32Array), 'Uint32Array')
27 t.ok(ista.loose(new Float32Array), 'Float32Array')
28 t.ok(ista.loose(new Float64Array), 'Float64Array')
29
30 t.ok(!ista.loose(new Array), 'Array')
31 t.ok(!ista.loose([]), '[]')
32
33 t.end()
34})
Note: See TracBrowser for help on using the repository browser.