Skip to content

Commit

Permalink
Add test for sb3 creation being deterministic over time
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jul 18, 2024
1 parent 4c366e0 commit 658ef8a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/integration/tw_deterministic_sb3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const {test} = require('tap');
const VM = require('../../src/virtual-machine');

test('saveProjectSb3 is deterministic over time', t => {
const vm = new VM();
Promise.all([
vm.saveProjectSb3('nodebuffer'),
// Zip modification time is only accurate to the second
new Promise(resolve => setTimeout(resolve, 1000)).then(() => vm.saveProjectSb3('nodebuffer'))
]).then(([a, b]) => {
t.same(a, b);
t.end();
});
});

0 comments on commit 658ef8a

Please sign in to comment.