mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-14 07:21:32 -04:00
Fix up tests and remove unused function.
This commit is contained in:
parent
86d61a4c20
commit
431e92aa54
3 changed files with 6 additions and 60 deletions
test/unit
|
@ -10,10 +10,11 @@ test('spec', t => {
|
|||
|
||||
t.type(cloud, 'object');
|
||||
t.type(cloud.postData, 'function');
|
||||
t.type(cloud.requestUpdateVariable, 'function');
|
||||
t.type(cloud.updateCloudVariable, 'function');
|
||||
t.type(cloud.requestCreateVariable, 'function');
|
||||
t.type(cloud.createCloudVariable, 'function');
|
||||
t.type(cloud.requestUpdateVariable, 'function');
|
||||
t.type(cloud.requestRenameVariable, 'function');
|
||||
t.type(cloud.requestDeleteVariable, 'function');
|
||||
t.type(cloud.updateCloudVariable, 'function');
|
||||
t.type(cloud.setProvider, 'function');
|
||||
t.type(cloud.setStage, 'function');
|
||||
t.type(cloud.clear, 'function');
|
||||
|
@ -66,30 +67,6 @@ test('postData update message updates the variable', t => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('postData create message sets isCloud flag on the variable and updates runtime cloud limit', t => {
|
||||
const stage = new Target();
|
||||
const fooVar = new Variable(
|
||||
'a fake var id',
|
||||
'foo',
|
||||
Variable.SCALAR_TYPE,
|
||||
false /* isCloud */
|
||||
);
|
||||
stage.variables[fooVar.id] = fooVar;
|
||||
|
||||
t.strictEquals(fooVar.value, 0);
|
||||
t.strictEquals(fooVar.isCloud, false);
|
||||
|
||||
const runtime = new Runtime();
|
||||
const cloud = new Cloud(runtime);
|
||||
cloud.setStage(stage);
|
||||
cloud.postData({varCreate: {
|
||||
name: 'foo'
|
||||
}});
|
||||
t.strictEquals(fooVar.isCloud, true);
|
||||
t.strictEquals(runtime.hasCloudData(), true);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('requestUpdateVariable calls provider\'s updateVariable function', t => {
|
||||
let updateVariableCalled = false;
|
||||
let mockVarName = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue