napi-rs/examples/napi-compat-mode/__tests__/cleanup-env.spec.ts
forehal a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +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)
})
})