bitburner-src/test/jest/Script/Script.test.ts

20 lines
531 B
TypeScript
Raw Normal View History

import { Script } from "../../../src/Script/Script";
2022-01-15 04:32:44 +01:00
2022-03-30 16:08:32 +02:00
const code = `/** @param {NS} ns */
2022-01-15 04:32:44 +01:00
export async function main(ns) {
ns.print(ns.getWeakenTime('n00dles'));
}`;
describe("Validate Save Script Works", function () {
2022-04-07 01:30:08 +02:00
it("Save", function () {
const server = "home";
const filename = "test.js";
const script = new Script();
2022-10-01 21:03:47 +02:00
script.saveScript(filename, code, server, []);
2022-01-15 04:32:44 +01:00
2022-04-07 01:30:08 +02:00
expect(script.filename).toEqual(filename);
expect(script.code).toEqual(code);
expect(script.server).toEqual(server);
});
});