Guest User

Untitled

a guest
Jan 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var Lightbulb = function () {
  2. this.isOn = false;
  3. },
  4. lightbulb = new Lightbulb();
  5.  
  6. Lightbulb.prototype.toggle = function () {
  7. this.isOn = !this.isOn;
  8. return this.isOn;
  9. };
  10.  
  11. test('lightbulb sin IIFE.', function () {
  12. equal(lightbulb.toggle(), true, 'Lightbulb retorna on.');
  13. equal(lightbulb.toggle(), false, 'Lightbulb retorna off.');
  14. });
Add Comment
Please, Sign In to add comment