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:
+3
-3
@@ -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: () => {} };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user