1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-29 14:51:17 +00:00
8bitworkshop/test/cli/testutil.js

20 lines
507 B
JavaScript

var vm = require('vm');
var fs = require('fs');
var assert = require('assert');
var includeInThisContext = function(path) {
var code = fs.readFileSync(path);
vm.runInThisContext(code, path);
};
includeInThisContext("gen/emu.js");
includeInThisContext("gen/util.js");
includeInThisContext("src/platform/nes.js");
describe('LZG', function() {
it('Should decode LZG', function() {
var rom = new Uint8Array(new lzgmini().decode(NES_CONIO_ROM_LZG));
assert.equal(40977, rom.length);
});
});