LongYinan 583a2ba5c8
chore(triples): update target list (#2879)
* chore(triples): update target list

* convert compat tests to esm

* Fix node 20 test
2025-08-15 18:31:56 +08:00

30 lines
811 B
TypeScript

import test from 'ava'
// @ts-expect-error
import bindings from '../index.node'
test('should be able to concat string', (t) => {
const fixture = 'JavaScript 🌳 你好 napi'
t.snapshot(bindings.concatString(fixture))
})
test('should be able to concat string with char \0', (t) => {
const fixture = 'JavaScript \0 🌳 你好 \0 napi'
t.snapshot(fixture)
t.snapshot(bindings.concatString(fixture))
})
test('should be able to concat utf16 string', (t) => {
const fixture = 'JavaScript 🌳 你好 napi'
t.snapshot(bindings.concatUTF16String(fixture))
})
test('should be able to concat latin1 string', (t) => {
const fixture = 'æ¶½¾DEL'
t.snapshot(bindings.concatLatin1String(fixture))
})
test('should be able to crate latin1 string', (t) => {
t.snapshot(bindings.createLatin1())
})