napi-rs/test_module/__test__/cleanup-env.spec.ts
2020-10-04 16:02:04 +08:00

17 lines
386 B
TypeScript

import test from 'ava'
const bindings = require('../index.node')
test('should be able to add cleanup hook', (t) => {
t.notThrows(() => {
const ret = bindings.addCleanupHook()
t.is(typeof ret, 'object')
})
})
test('should be able to remove cleanup hook', (t) => {
t.notThrows(() => {
const ret = bindings.addCleanupHook()
bindings.removeCleanupHook(ret)
})
})