mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
33 lines
867 B
JavaScript
33 lines
867 B
JavaScript
var test = require('tap').test;
|
|
var extract = require('../fixtures/extract');
|
|
var VirtualMachine = require('../../src/index');
|
|
|
|
var path = __dirname + '/../fixtures/data.sb2';
|
|
var project = extract(path);
|
|
|
|
test('data project', function (t) {
|
|
var vm = new VirtualMachine();
|
|
|
|
// Evaluate playground data and exit
|
|
vm.on('playgroundData', function () {
|
|
// @todo Additional tests
|
|
t.end();
|
|
process.nextTick(process.exit);
|
|
});
|
|
|
|
// Start VM, load project, and run
|
|
t.doesNotThrow(function () {
|
|
vm.start();
|
|
vm.clear();
|
|
vm.setCompatibilityMode(false);
|
|
vm.setTurboMode(false);
|
|
vm.loadProject(project);
|
|
vm.greenFlag();
|
|
});
|
|
|
|
// After two seconds, get playground data and stop
|
|
setTimeout(function () {
|
|
vm.getPlaygroundData();
|
|
vm.stopAll();
|
|
}, 2000);
|
|
});
|