diff --git a/calculator/test.js b/calculator/test.js index b954a21..d443d05 100644 --- a/calculator/test.js +++ b/calculator/test.js @@ -44,10 +44,8 @@ global.g = { global.Graphics = {}; -// Mock 'process' -global.process = { - env: { HWVERSION: 2 } // Simulate Bangle.js 2 -}; +// Mock Bangle.js-specific process.env properties +process.env.HWVERSION = 2; // Simulate Bangle.js 2 // Mock 'Bangle' global.Bangle = { @@ -252,37 +250,37 @@ test('Long number with separators', () => { test('Sine (deg)', () => { press('30'); - press('sin'); + buttonPress('sin'); checkDisplay('0.5'); press('R'); press('R'); press('90'); - press('sin'); + buttonPress('sin'); checkDisplay('1'); press('R'); press('R'); press('180'); - press('sin'); + buttonPress('sin'); checkDisplay('0'); }); test('Cosine (deg)', () => { press('60'); - press('cos'); + buttonPress('cos'); checkDisplay('0.5'); press('R'); press('R'); press('0'); - press('cos'); + buttonPress('cos'); checkDisplay('1'); press('R'); press('R'); press('90'); - press('cos'); + buttonPress('cos'); checkDisplay('0'); }); test('Angle mode switch to radians and back', () => { - press('angleMode'); // now rad + buttonPress('angleMode'); // now rad // The buttonPress function doesn't return the state, but we can check the object it modifies assert.strictEqual(scientificOperators.angleMode.val, 'rad'); - press('angleMode'); // back to deg + buttonPress('angleMode'); // back to deg assert.strictEqual(scientificOperators.angleMode.val, 'deg'); });