napi-rs/examples/napi-compat-mode/__tests__/either.spec.ts

15 lines
394 B
TypeScript
Raw Normal View History

import test from 'ava'
2020-07-18 03:00:48 +09:00
const bindings = require('../index.node')
test('either should work', (t) => {
const fixture = 'napi'
t.is(bindings.eitherNumberString(1), 101)
t.is(bindings.eitherNumberString(fixture), `Either::B(${fixture})`)
})
test('dynamic argument length should work', (t) => {
t.is(bindings.dynamicArgumentLength(1), 101)
t.is(bindings.dynamicArgumentLength(), 42)
})