diff --git a/src/calculator.spec.ts b/src/calculator.spec.ts index f8dede2..c77a9ae 100644 --- a/src/calculator.spec.ts +++ b/src/calculator.spec.ts @@ -24,14 +24,14 @@ describe('Calulator: no starting value', () => { expect(calc.total).toEqual(13); }) - // it('can perform subtraction', () => { - // calc.minus(1) - // expect(calc.total).toEqual(-1); - // calc.minus(2) - // expect(calc.total).toEqual(-3); - // calc.minus(3) - // expect(calc.total).toEqual(-6); - // }) + it('can perform subtraction', () => { + calc.minus(1) + expect(calc.total).toEqual(-1); + calc.minus(2) + expect(calc.total).toEqual(-3); + calc.minus(3) + expect(calc.total).toEqual(-6); + }) }); describe('Calulator: starting value 99', () => { diff --git a/src/calculator.ts b/src/calculator.ts index 420213b..425be5b 100644 --- a/src/calculator.ts +++ b/src/calculator.ts @@ -1,9 +1,16 @@ +function test(foo) { + if(foo === 'bar') return true + return false +} + export default class Calculator { private value = 0; private calcMode = "" constructor(scientificMode = false, value = 0) { this.value = value + test('biz') + if(scientificMode) { this.calcMode = "science!" } else if(scientificMode && this.value > 0) {