95dd6ef485
* Refactor js-binding to support bundling single-package artifacts The existsSync check breaks the bundlers I've tested (esbuild, webpack, ncc), so you cannot bundle napi-rs packages that have all binarys in a single package. I've tested this change with both single package and multi package libraries. * Update snapshots * Update CI * Fix electron test --------- Co-authored-by: Caleb ツ Everett <calebev@amazon.com> Co-authored-by: LongYinan <lynweklm@gmail.com>
15 lines
287 B
TypeScript
15 lines
287 B
TypeScript
import test from 'ava'
|
|
|
|
import { NotWritableClass } from '../index.cjs'
|
|
|
|
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 = () => {}
|
|
})
|
|
})
|