mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 03:00:56 +02:00
Added Bladeburner API (untested). Rebalanced Bladeburner. Bladeburner progress no longer resets when installing Augmentations. Fixed up BN-12
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
});*/
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user