Skip to content

Commit 78acdb7

Browse files
author
Alan Shaw
committed
Fixes #10
1 parent 55d6ceb commit 78acdb7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

exercises/blink_blink/exercise.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,16 @@ exercise.addVerifyProcessor(function (callback) {
4848
expect(led, 'no led instance created').to.exist
4949

5050
expect(led.pin, 'led expected to be connected to pin 13').to.equal(13)
51-
expect(led.strobe.called, 'led.strobe was not called').to.be.true
52-
expect(led.strobe.getCall(0).args[0], 'led.strobe was not called with 1000').to.equal(1000)
51+
52+
if (!led.strobe.called && !led.blink.called) {
53+
expect(led.strobe.called, 'led.strobe was not called').to.be.true
54+
}
55+
56+
if (led.blink.called) {
57+
expect(led.blink.getCall(0).args[0], 'led.blink was not called with 1000').to.equal(1000)
58+
} else {
59+
expect(led.strobe.getCall(0).args[0], 'led.strobe was not called with 1000').to.equal(1000)
60+
}
5361

5462
// should have set pin 13 into digital output mode
5563
expect(io.pinMode.calledWith(13, io.MODES.OUTPUT)).to.be.true

0 commit comments

Comments
 (0)