2023-11-02 13:57:11 +09:00
|
|
|
import ava from 'ava'
|
2023-09-20 17:18:01 +09:00
|
|
|
|
2023-11-02 13:57:11 +09:00
|
|
|
const { NotWritableClass } = (await import('../index.js')).default
|
2022-08-06 22:54:58 +09:00
|
|
|
|
2023-11-02 13:57:11 +09:00
|
|
|
const test = process.env.WASI_TEST ? ava.skip : ava
|
2022-08-06 22:54:58 +09:00
|
|
|
|
|
|
|
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 = () => {}
|
|
|
|
})
|
|
|
|
})
|