Hide the private API of the NodeJS integration

Hide it behind a `private_api` property in the module export.
This commit is contained in:
Simon Hausmann 2020-10-20 16:52:28 +02:00
parent 4bc72ec6b3
commit f6d8f78e3f
2 changed files with 8 additions and 6 deletions

View file

@ -119,6 +119,8 @@ class ArrayModel<T> {
} }
} }
native.ArrayModel = ArrayModel;
module.exports = native; module.exports = {
private_api: native,
ArrayModel: ArrayModel
};

View file

@ -110,14 +110,14 @@ assert.equal(instance.hello, 40);
assert.equal(instance.binding_dep, 100); assert.equal(instance.binding_dep, 100);
// Half the animation // Half the animation
sixtyfpslib.mock_elapsed_time(600); sixtyfpslib.private_api.mock_elapsed_time(600);
assert.equal(instance.hello, 50); assert.equal(instance.hello, 50);
assert.equal(instance.binding_dep, 125); assert.equal(instance.binding_dep, 125);
// Remaining half // Remaining half
sixtyfpslib.mock_elapsed_time(600); sixtyfpslib.private_api.mock_elapsed_time(600);
assert.equal(instance.hello, 60); assert.equal(instance.hello, 60);
assert.equal(instance.binding_dep, 150); assert.equal(instance.binding_dep, 150);
sixtyfpslib.mock_elapsed_time(100); sixtyfpslib.private_api.mock_elapsed_time(100);
assert.equal(instance.hello, 60); assert.equal(instance.hello, 60);
assert.equal(instance.binding_dep, 150); assert.equal(instance.binding_dep, 150);
@ -125,7 +125,7 @@ assert.equal(instance.binding_dep, 150);
// querying the value (because te dirty event should cause the animation to start) // querying the value (because te dirty event should cause the animation to start)
instance.condition = true; instance.condition = true;
instance.hello = 30; instance.hello = 30;
sixtyfpslib.mock_elapsed_time(600); sixtyfpslib.private_api.mock_elapsed_time(600);
assert.equal(instance.hello, 45); assert.equal(instance.hello, 45);
assert.equal(instance.binding_dep, 125); assert.equal(instance.binding_dep, 125);