fix: Parse numeric input for scientific ops and expose operators to tests

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-03-14 16:34:49 -06:00
committed by Tanner
parent 6ae1b173bd
commit 2c91af6759
2 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -66,9 +66,9 @@ global.load = () => {};
// We wrap the app code in a function that returns the buttonPress function,
// so we can capture it and use it in our tests.
const calculatorCode = fs.readFileSync(path.join(__dirname, 'calculator.app.js'), 'utf8');
const wrappedCode = `(function(require) { ${calculatorCode}; return buttonPress; })`;
const getButtonPress = eval(wrappedCode);
const buttonPress = getButtonPress((name) => {
const wrappedCode = `(function(require) { ${calculatorCode}; return { buttonPress, scientificOperators }; })`;
const getAppFns = eval(wrappedCode);
const { buttonPress, scientificOperators } = getAppFns((name) => {
if (name === "FontDylex7x13") {
return { add: () => {} };
}