Skip to content

Commit

Permalink
fix: unit test for change 1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
X3ZvaWQ committed Jan 27, 2024
1 parent dbd62a2 commit 02a5f49
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/engine.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-sparse-arrays */
const { JsType, LuaThread, LuaType, LuaReturn } = require('../dist/index');
const { expect } = require('chai');
// const { getEngine, getFactory } = require('./utils');
Expand Down Expand Up @@ -104,16 +105,15 @@ describe('Engine', () => {
return { obj1 = obj1, obj2 }
`);

const obj = [[5]];
obj[0]['hello'] = 'everybody';
obj[0]['array'] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
obj[0]['fn'] = value[0]['fn'];
const obj = [, [, 5]];
obj[1]['hello'] = 'everybody';
obj[1]['array'] = [, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
obj[1]['fn'] = value[1]['fn'];
obj['obj1'] = {
hello: 'world',
};
obj['obj1'].self = obj['obj1'];
obj[0].self = obj[0];

obj[1].self = obj[1];
expect(value).to.deep.eql(obj);
});

Expand All @@ -128,7 +128,7 @@ describe('Engine', () => {
return obj
`);

const arr = ['hello', 'world'];
const arr = [undefined, 'hello', 'world'];
arr.push(arr);
expect(value).to.be.eql(arr);
});
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('Engine', () => {
end
`);

expect(sum([10, 50, 25])).to.be.equal(85);
expect(sum([undefined, 10, 50, 25])).to.be.equal(85);
});

it('call a global function with multiple returns should succeed', async () => {
Expand Down

0 comments on commit 02a5f49

Please sign in to comment.