Use beforeEach instead of a fake set up test

This commit is contained in:
Karishma Chadha 2019-01-28 10:53:42 -05:00
parent 94fa3d56c8
commit 18e9a08775

View file

@ -1,27 +1,27 @@
const path = require('path');
const test = require('tap').test;
const tap = require('tap');
const makeTestStorage = require('../fixtures/make-test-storage');
const readFileToBuffer = require('../fixtures/readProjectFile').readFileToBuffer;
const VirtualMachine = require('../../src/index');
const projectUri = path.resolve(__dirname, '../fixtures/monitors.sb2');
const project = readFileToBuffer(projectUri);
let vm;
const vm = new VirtualMachine();
vm.attachStorage(makeTestStorage());
tap.beforeEach(() => {
const projectUri = path.resolve(__dirname, '../fixtures/monitors.sb2');
const project = readFileToBuffer(projectUri);
// TODO figure out why running threads doesn't work in this test
// vm.start();
vm.clear();
vm.setCompatibilityMode(false);
vm.setTurboMode(false);
vm = new VirtualMachine();
vm.attachStorage(makeTestStorage());
test('Set Up - load the sb2 project', t => {
vm.loadProject(project).then(() => {
t.pass('Successfully Loaded!');
t.end();
});
// TODO figure out why running threads doesn't work in this test
// vm.start();
vm.clear();
vm.setCompatibilityMode(false);
vm.setTurboMode(false);
return vm.loadProject(project);
});
const test = tap.test;
test('saving and loading sb2 project with monitors preserves sliderMin and sliderMax', t => {