napi-rs/test_module/__test__/arraybuffer.spec.ts

9 lines
242 B
TypeScript
Raw Normal View History

import test from 'ava'
const bindings = require('../index.node')
test('should get arraybuffer length', (t) => {
const fixture = Buffer.from('wow, hello')
t.is(bindings.getArraybufferLength(fixture.buffer), fixture.buffer.byteLength)
})