Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Lightbulb = function () {
- this.isOn = false;
- },
- lightbulb = new Lightbulb();
- Lightbulb.prototype.toggle = function () {
- this.isOn = !this.isOn;
- return this.isOn;
- };
- test('lightbulb sin IIFE.', function () {
- equal(lightbulb.toggle(), true, 'Lightbulb retorna on.');
- equal(lightbulb.toggle(), false, 'Lightbulb retorna off.');
- });
Add Comment
Please, Sign In to add comment