Skip to content

Instantly share code, notes, and snippets.

@nicokosi
Created April 8, 2020 05:09
Show Gist options
  • Save nicokosi/97d4843aeb9459340afb4c4bfd247e34 to your computer and use it in GitHub Desktop.
Save nicokosi/97d4843aeb9459340afb4c4bfd247e34 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = {
roman
};
function roman(arabic) {
let r = "I".repeat(arabic);
if (arabic === 4) {
return "IV";
}
return r;
}
'use strict';
const roman = require('./roman.js');
describe('Should convert roman', () => {
it('from 1', () => roman.roman(1).should.equal("I"));
it('from 2', () => roman.roman(2).should.equal("II"));
it('from 3', () => roman.roman(3).should.equal("III"));
it('from 4', () => roman.roman(4).should.equal("IV"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment