Skip to content

Instantly share code, notes, and snippets.

@sethetter
Created February 17, 2014 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethetter/9052726 to your computer and use it in GitHub Desktop.
Save sethetter/9052726 to your computer and use it in GitHub Desktop.
var fizzBuzz = require('../fizzbuzz')
, should = require('chai').should();
describe('FizzBuzz Challenge', function() {
it('should print "fizz" for multiples of 3', function() {
fizzBuzz(3)[0].should.equal('fizz');
fizzBuzz(9)[0].should.equal('fizz');
fizzBuzz(333)[0].should.equal('fizz');
});
it('should print "buzz" for multiples of 5', function() {
fizzBuzz(5)[0].should.equal('buzz');
fizzBuzz(10)[0].should.equal('buzz');
fizzBuzz(100)[0].should.equal('buzz');
});
it('should print "fizzbuzz" for multiples of 3 and 5', function() {
fizzBuzz(15)[0].should.equal('fizzbuzz');
fizzBuzz(30)[0].should.equal('fizzbuzz');
fizzBuzz(300)[0].should.equal('fizzbuzz');
});
it('should print the number for anything not multiple of 3 or 5', function() {
fizzBuzz(7)[0].should.equal(7);
fizzBuzz(13)[0].should.equal(13);
fizzBuzz(103)[0].should.equal(103);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment