2022-01-25 22:24:09 +01:00
|
|
|
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();
|
2023-04-07 06:33:51 +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);
|
|
|
|
});
|
2022-01-25 22:24:09 +01:00
|
|
|
});
|