bitburner-src/test/jest/Script/Script.test.ts
Snarling 04d49e3a6d
SCRIPTS: Script modules are reused when they are imported (#461)
Also corrects some compile race conditions.
2023-04-07 00:33:51 -04:00

20 lines
527 B
TypeScript

import { Script } from "../../../src/Script/Script";
const code = `/** @param {NS} ns */
export async function main(ns) {
ns.print(ns.getWeakenTime('n00dles'));
}`;
describe("Validate Save Script Works", function () {
it("Save", function () {
const server = "home";
const filename = "test.js";
const script = new Script();
script.saveScript(filename, code, server);
expect(script.filename).toEqual(filename);
expect(script.code).toEqual(code);
expect(script.server).toEqual(server);
});
});