mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-03 01:30:27 -04:00
Merge pull request #979 from kchadha/serialization-cleanup
SB3 Serialization & Load Project
This commit is contained in:
commit
dbc7b9597f
5 changed files with 202 additions and 74 deletions
test/unit
|
@ -5,11 +5,13 @@ const demoSb3 = require('../fixtures/demo.json');
|
|||
|
||||
test('serialize', t => {
|
||||
const vm = new VirtualMachine();
|
||||
vm.fromJSON(JSON.stringify(demoSb3));
|
||||
const result = sb3.serialize(vm.runtime);
|
||||
// @todo Analyze
|
||||
t.type(JSON.stringify(result), 'string');
|
||||
t.end();
|
||||
vm.loadProject(JSON.stringify(demoSb3))
|
||||
.then(() => {
|
||||
const result = sb3.serialize(vm.runtime);
|
||||
// @todo Analyze
|
||||
t.type(JSON.stringify(result), 'string');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('deserialize', t => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue