Add test for sb3 creation being deterministic over time

This commit is contained in:
Muffin committed 2024-07-18 12:44:49 -05:00
1 parent 4c366e0110
commit 658ef8aba7
1 file changed
+14
+14
View File
@@ -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();
});
});