You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

10 lines
627 B

import test from 'ava';
import m from '..';
test('dataView', t => {
t.notThrows(() => m(new DataView(new ArrayBuffer(1)), m.dataView));
t.notThrows(() => m(new DataView(new ArrayBuffer(1)), m.dataView.label('data')));
t.throws(() => m(new ArrayBuffer(1) as any, m.dataView), 'Expected argument to be of type `DataView` but received type `ArrayBuffer`');
t.throws(() => m(new ArrayBuffer(1) as any, m.dataView.label('data')), 'Expected `data` to be of type `DataView` but received type `ArrayBuffer`');
t.throws(() => m(12 as any, m.dataView), 'Expected argument to be of type `DataView` but received type `number`');
});