mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-25 09:01:07 -05:00
Add pen integration test
See `pen.sb2` for details
This commit is contained in:
parent
d0845728ee
commit
72f17d6dc4
2 changed files with 34 additions and 0 deletions
BIN
test/fixtures/pen.sb2
vendored
Normal file
BIN
test/fixtures/pen.sb2
vendored
Normal file
Binary file not shown.
34
test/integration/pen.js
Normal file
34
test/integration/pen.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
var path = require('path');
|
||||||
|
var test = require('tap').test;
|
||||||
|
var extract = require('../fixtures/extract');
|
||||||
|
var VirtualMachine = require('../../src/index');
|
||||||
|
|
||||||
|
var uri = path.resolve(__dirname, '../fixtures/pen.sb2');
|
||||||
|
var project = extract(uri);
|
||||||
|
|
||||||
|
test('pen', 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);
|
||||||
|
});
|
Loading…
Reference in a new issue