Build out integration test SB2 files

This commit is contained in:
Andrew Sliwinski 2016-12-23 21:08:13 -05:00
parent b8af7c0723
commit dfc6614a5b
16 changed files with 122 additions and 304 deletions
test/integration

33
test/integration/data.js Normal file
View file

@ -0,0 +1,33 @@
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);
});