Skip to content

Commit bd76d49

Browse files
committed
test(api): fix calculator test
1 parent 93d3e75 commit bd76d49

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

apps/api/src/nodes/math/calculator-node.test.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,6 @@ describe("CalculatorNode", () => {
2424
toolRegistry: null,
2525
}) as unknown as NodeContext;
2626

27-
describe("nodeType", () => {
28-
it("should have correct node type definition", () => {
29-
expect(CalculatorNode.nodeType).toEqual({
30-
id: "calculator",
31-
name: "Calculator",
32-
type: "calculator",
33-
description:
34-
"Evaluates mathematical expressions with comprehensive support for arithmetic operations, mathematical functions, trigonometric functions, constants, and complex formulas. Supports: basic arithmetic (+, -, *, /, ^, %), bitwise operators (&, |, <, >, ~), mathematical functions (sqrt, cbrt, pow, exp, log, log10, abs, floor, ceil, round, min, max, sign, trunc, hypot), trigonometric functions (sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, asinh, acosh, atanh), mathematical constants (PI, E), random numbers, and complex nested expressions with proper order of operations and parentheses. All inputs are validated for security and only mathematical operations are allowed.",
35-
tags: ["Math"],
36-
icon: "calculator",
37-
inlinable: true,
38-
asTool: true,
39-
inputs: [
40-
{
41-
name: "expression",
42-
type: "string",
43-
description:
44-
"The mathematical expression to evaluate as a string. Examples: '2 + 3 * 4', 'sqrt(16)', 'sin(PI/2)', 'pow(2, 3)', 'abs(-5)', 'floor(3.7)', 'PI * 2^2', '(10 + 5) * 2 / 4', 'log(100)', 'random * 10', '17 % 5', '15 & 7', '8 | 4', '~10'. Supports all standard mathematical operations, functions, and constants. Use ^ for exponentiation (e.g., 2^3 = 8), % for modulo (e.g., 17 % 5 = 2), & for bitwise AND, | for bitwise OR, ~ for bitwise NOT. All expressions are validated for security.",
45-
required: true,
46-
},
47-
],
48-
outputs: [
49-
{
50-
name: "result",
51-
type: "number",
52-
description:
53-
"The calculated result of the mathematical expression as a number. Returns the final computed value after evaluating the expression with proper order of operations. Will be NaN or throw an error for invalid expressions.",
54-
},
55-
],
56-
});
57-
});
58-
});
59-
6027
describe("execute", () => {
6128
it("should evaluate simple arithmetic expressions", async () => {
6229
const node = new CalculatorNode(createNode());

0 commit comments

Comments
 (0)