From 6c12f20df43ccc5a89f93889b72df00a918f1e3b Mon Sep 17 00:00:00 2001 From: Marcel Erz Date: Fri, 27 Jun 2025 05:20:02 -0700 Subject: [PATCH] Fix manual section markers and update manual sections test --- src/__tests__/SignedCode-test.js | 15 +++++++++------ src/__tests__/SignedCodeBuilder-test.js | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/__tests__/SignedCode-test.js b/src/__tests__/SignedCode-test.js index 0870b2d..01ea8fb 100644 --- a/src/__tests__/SignedCode-test.js +++ b/src/__tests__/SignedCode-test.js @@ -22,13 +22,13 @@ import TestModule from "TestModule"; TestModule.someCall(24, 67); function printEverything() { - // + // console.log("42 is the answer!"); // } function someOtherFunction() { - // + // console.log("I don't know"); // } @@ -73,10 +73,13 @@ describe("signedCode", () => { expect(instance.getVersion()).toStrictEqual(368); }); - it("gets the manual sections", () => { - const instance = new SignedCode(signedTestCode(validChecksum)); - expect(instance.getManualSections()).toMatchSnapshot(); - }); + it("gets the manual sections", () => { + const instance = new SignedCode(signedTestCode(validChecksum)); + expect(instance.getManualSections()).toStrictEqual({ + "init-code": { code: "\n console.log(\"42 is the answer!\");\n" }, + "more-code": { code: "\n console.log(\"I don't know\");\n" }, + }); + }); it("resigns code", () => { const instance = new SignedCode(signedTestCode(invalidChecksum)); diff --git a/src/__tests__/SignedCodeBuilder-test.js b/src/__tests__/SignedCodeBuilder-test.js index 6453494..468080d 100644 --- a/src/__tests__/SignedCodeBuilder-test.js +++ b/src/__tests__/SignedCodeBuilder-test.js @@ -23,13 +23,13 @@ import TestModule from "TestModule"; TestModule.someCall(24, 67); function printEverything() { - // + // console.log("42 is the answer!"); // } function someOtherFunction() { - // + // console.log("I don't know"); // }