mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-13 17:04:39 -04:00
Fix tests & a typo
This commit is contained in:
parent
0af3de9bf0
commit
c88a8fa55a
5 changed files with 7 additions and 7 deletions
|
@ -74,7 +74,7 @@ const parseScratchObject = function (object, runtime, extensions) {
|
|||
}
|
||||
if (object.hasOwnProperty('blocks')) {
|
||||
for (const blockId in object.blocks) {
|
||||
const blockJSON = object.blockType[blockId];
|
||||
const blockJSON = object.blocks[blockId];
|
||||
blocks.createBlock(blockJSON);
|
||||
|
||||
const dotIndex = blockJSON.opcode.indexOf('.');
|
||||
|
|
|
@ -21,7 +21,7 @@ test('default', t => {
|
|||
// Create runtime instance & load SB2 into it
|
||||
const rt = new runtime();
|
||||
rt.attachStorage(makeTestStorage());
|
||||
sb2.deserialize(json, rt).then(targets => {
|
||||
sb2.deserialize(json, rt).then(({targets}) => {
|
||||
// Test
|
||||
t.type(file, 'string');
|
||||
t.type(json, 'object');
|
||||
|
|
|
@ -103,7 +103,7 @@ test('sb3-roundtrip', t => {
|
|||
return sb3.deserialize(serializedState, runtime2);
|
||||
});
|
||||
|
||||
return serializeAndDeserialize.then(targets => {
|
||||
return serializeAndDeserialize.then(({targets}) => {
|
||||
runtime2.targets = targets;
|
||||
testRuntimeState('copy', runtime2);
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ test('default', t => {
|
|||
|
||||
// Create runtime instance & load SB2 into it
|
||||
const rt = new Runtime();
|
||||
sb2.deserialize(json, rt).then(targets => {
|
||||
sb2.deserialize(json, rt).then(({targets}) => {
|
||||
// Test
|
||||
t.type(file, 'string');
|
||||
t.type(json, 'object');
|
||||
|
@ -60,7 +60,7 @@ test('data scoping', t => {
|
|||
|
||||
// Create runtime instance & load SB2 into it
|
||||
const rt = new Runtime();
|
||||
sb2.deserialize(json, rt).then(targets => {
|
||||
sb2.deserialize(json, rt).then(({targets}) => {
|
||||
const globalVariableIds = Object.keys(targets[0].variables);
|
||||
const localVariableIds = Object.keys(targets[1].variables);
|
||||
t.equal(targets[0].variables[globalVariableIds[0]].name, 'foo');
|
||||
|
|
|
@ -14,8 +14,8 @@ test('serialize', t => {
|
|||
|
||||
test('deserialize', t => {
|
||||
const vm = new VirtualMachine();
|
||||
sb3.deserialize('', vm.runtime).then(targets => {
|
||||
// @todo Analyize
|
||||
sb3.deserialize('', vm.runtime).then(({targets}) => {
|
||||
// @todo Analyze
|
||||
t.type(targets, 'object');
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue