Skip to content

Commit ccc1583

Browse files
authored
feat: Add a new function (#17)
2 parents bd2e048 + e08f8c9 commit ccc1583

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/bmssp.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ function printMessage(message) {
22
return message;
33
}
44

5-
export { printMessage };
5+
function processMessage(message) {
6+
return `Processed: ${message}`;
7+
}
8+
9+
export { printMessage, processMessage };

test/main.test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { describe, test, expect } from "@jest/globals";
2-
import { printMessage } from "../src/bmssp.mjs";
2+
import { printMessage, processMessage } from "../src/bmssp.mjs";
33

44
describe("printMessage", () => {
55
test("sends a message and gets the message back", () => {
66
let testValue = "Hello, bmssp!! Testing..";
77
expect(printMessage(testValue)).toBe(testValue);
88
});
99
});
10+
11+
describe("processMessage", () => {
12+
test("processes a message and returns the processed result", () => {
13+
let testValue = "Hello, bmssp!! Testing..";
14+
expect(processMessage(testValue)).toBe(`Processed: ${testValue}`);
15+
});
16+
});

0 commit comments

Comments
 (0)