mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-10 21:14:06 -04:00
Fix up docs and incorrect initialization of cloud data manager functions. Add 'spec' unit tests that the cloud data manager functions are actually functions.
This commit is contained in:
parent
1df6743a5f
commit
ffef2e92fc
2 changed files with 16 additions and 4 deletions
test/unit
|
@ -11,6 +11,13 @@ test('spec', t => {
|
|||
|
||||
t.type(Runtime, 'function');
|
||||
t.type(r, 'object');
|
||||
|
||||
// Test types of cloud data managing functions
|
||||
t.type(r.hasCloudData, 'function');
|
||||
t.type(r.canAddCloudVariable, 'function');
|
||||
t.type(r.addCloudVariable, 'function');
|
||||
t.type(r.removeCloudVariable, 'function');
|
||||
|
||||
t.ok(r instanceof Runtime);
|
||||
|
||||
t.end();
|
||||
|
@ -154,6 +161,7 @@ test('Cloud variable limit allows only 8 cloud variables', t => {
|
|||
rt.removeCloudVariable();
|
||||
|
||||
t.equal(rt.canAddCloudVariable(), true);
|
||||
rt.addCloudVariable();
|
||||
t.equal(rt.canAddCloudVariable(), false);
|
||||
|
||||
// Disposing of the runtime should reset the cloud variable limitations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue