napi-rs/examples/napi/__tests__/object-attr.spec.ts
LongYinan 1fe6ad0430
feat(napi): tokio multi-thread mode on wasi (#2501)
* feat(napi): tokio multi-thread mode on wasi

* tokio_unstable flag

* snapshot

* ensure runtime

* oncelock combine lazylock

* noop feature
2025-03-13 23:53:19 +08:00

20 lines
347 B
TypeScript

import test from 'ava'
import { NotWritableClass, shutdownRuntime } from '../index.cjs'
test.after(() => {
shutdownRuntime()
})
test('Not Writable Class', (t) => {
const obj = new NotWritableClass('1')
t.throws(() => {
obj.name = '2'
})
obj.setName('2')
t.is(obj.name, '2')
t.throws(() => {
obj.setName = () => {}
})
})