mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-02 16:44:30 -04:00
Use beforeEach instead of a fake set up test
This commit is contained in:
parent
94fa3d56c8
commit
18e9a08775
1 changed files with 15 additions and 15 deletions
|
@ -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 => {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue