2020-08-24 17:16:35 +09:00
|
|
|
import test from 'ava'
|
2020-06-19 17:16:28 +09:00
|
|
|
|
|
|
|
const bindings = require('../index.node')
|
|
|
|
|
|
|
|
test('should create external object and get it back', (t) => {
|
|
|
|
const fixture = 42
|
|
|
|
const externalObject = bindings.createExternal(42)
|
|
|
|
t.is(bindings.getExternalCount(externalObject), fixture)
|
|
|
|
})
|
2021-03-11 20:02:42 +09:00
|
|
|
|
|
|
|
test('should create external with size hint', (t) => {
|
|
|
|
const fixture = 42
|
|
|
|
const externalObject = bindings.createExternalWithHint(42)
|
|
|
|
t.is(bindings.getExternalCount(externalObject), fixture)
|
|
|
|
})
|