mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add a Node.js wrapper library
The implementation is very similar to the Python wrapper.
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
import test from 'ava'
|
||||
|
||||
import { sum } from '../index.js'
|
||||
import { liblootVersion, isCompatible, Group } from '../index.js'
|
||||
|
||||
test('sum from native', (t) => {
|
||||
t.is(sum(1, 2), 3)
|
||||
test('liblootVersion', t => {
|
||||
t.is(liblootVersion(), "0.26.0")
|
||||
});
|
||||
|
||||
test('isCompatible', t => {
|
||||
t.is(isCompatible(0, 26, 0), true)
|
||||
});
|
||||
|
||||
test('Group equality', t => {
|
||||
const group1 = new Group("A");
|
||||
const group2 = new Group("A");
|
||||
const group3 = new Group("B");
|
||||
|
||||
t.deepEqual(group1.name, group2.name);
|
||||
t.notDeepEqual(group1.name, group3.name);
|
||||
|
||||
t.deepEqual(group1, group2);
|
||||
|
||||
// The objects have no public fields so appear to be equal.
|
||||
t.deepEqual(group1, group3);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user