scratch-vm/test/unit/serialization_sb3.js

20 lines
548 B
JavaScript
Raw Normal View History

2017-04-26 16:50:53 -04:00
const test = require('tap').test;
const VirtualMachine = require('../../src/index');
const sb3 = require('../../src/serialization/sb3');
2016-12-30 10:19:58 -05:00
2017-04-26 16:50:53 -04:00
test('serialize', t => {
const vm = new VirtualMachine();
2016-12-30 10:19:58 -05:00
vm.fromJSON(JSON.stringify(require('../fixtures/demo.json')));
2017-04-26 16:50:53 -04:00
const result = sb3.serialize(vm.runtime);
2016-12-30 10:19:58 -05:00
console.dir(JSON.stringify(result));
2017-04-26 16:50:53 -04:00
// @todo Analyze
2016-12-30 10:19:58 -05:00
t.end();
});
2017-04-26 16:50:53 -04:00
test('deserialize', t => {
const vm = new VirtualMachine();
const result = sb3.deserialize('', vm.runtime);
2016-12-30 10:19:58 -05:00
// @todo Analyize
t.end();
});