mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
* feat(napi): tokio multi-thread mode on wasi * tokio_unstable flag * snapshot * ensure runtime * oncelock combine lazylock * noop feature
20 lines
347 B
TypeScript
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 = () => {}
|
|
})
|
|
})
|