Added Bladeburner API (untested). Rebalanced Bladeburner. Bladeburner progress no longer resets when installing Augmentations. Fixed up BN-12

This commit is contained in:
danielyxie
2018-06-08 10:51:48 -05:00
parent 2332532d91
commit 5e38355152
16 changed files with 2480 additions and 738 deletions
+8 -5
View File
@@ -1,4 +1,5 @@
import {executeJSScript} from "../src/NetscriptJSEvaluator.js";
import {WorkerScript} from "../src/NetscriptWorker.js";
const chai = require("chai");
const chaiAsPromised = require("chai-as-promised");
@@ -9,17 +10,19 @@ console.info('asdf');
describe('NSJS ScriptStore', function() {
it('should run an imported function', async function() {
const s = { filename: "", code: "export function main() { return 2; }" };
chai.expect(await executeJSScript(s)).to.equal(2);
const s = { filename: "", code: "export function main() { return 2; }", args:[]};
const worker = new WorkerScript(s);
chai.expect(await executeJSScript([], s)).to.equal(2);
});
/*
it('should handle recursive imports', async function() {
const s1 = { filename: "s1.js", code: "export function iAmRecursiveImport(x) { return x + 2; }" };
const s2 = { filename: "", code: `
import {iAmRecursiveImport} from \"s1.js\";
export function main() { return iAmRecursiveImport(3);
}`};
chai.expect(await executeJSScript(s2, [s1, s2])).to.equal(5);
chai.expect(await executeJSScript([s1, s2], s2)).to.equal(5);
});
it (`should correctly reference the passed global env`, async function() {
@@ -45,5 +48,5 @@ describe('NSJS ScriptStore', function() {
export function main() {}
`}
executeJSScript(s2, [s1, s2]).should.eventually.throw();
});
});
});*/
});