--- /dev/null
+/* eslint-env mocha */
+'use strict';
+
+const assert = require('assert');
+const { toRoman } = require('../index');
+
+const noExpectedException = 'did not get expected exception';
+
+// Ⅰ Ⅰ
+// Ⅱ Ⅱ
+// Ⅲ Ⅲ
+// Ⅳ Ⅳ
+// Ⅴ Ⅴ
+// Ⅵ Ⅵ
+// Ⅶ Ⅶ
+// Ⅷ Ⅷ
+// Ⅸ Ⅸ
+// Ⅹ Ⅹ
+// Ⅺ Ⅺ
+// Ⅻ Ⅻ
+// ⅩⅬ ⅩⅬ
+// Ⅼ Ⅼ
+// ⅩⅭ ⅩⅭ
+// Ⅽ Ⅽ
+// ⅭⅮ ⅭⅮ
+// Ⅾ Ⅾ
+// ⅭⅯ ⅭⅯ
+// Ⅿ Ⅿ
+
+const spotChecks = {
+ 13: 'ⅩⅠⅠⅠ',
+ 40: 'ⅩⅬ',
+ 90: 'ⅩⅭ',
+ 99: 'ⅩⅭⅠⅩ',
+ 400: 'ⅭⅮ',
+ 900: 'ⅭⅯ',
+ 2022: 'ⅯⅯⅩⅩⅠⅠ',
+};
+
+describe('toRoman', function () {
+ it('requires a value', function () {
+ try {
+ toRoman();
+ assert.fail(noExpectedException);
+ } catch (e) {
+ assert(e instanceof RangeError, noExpectedException);
+ }
+ });
+
+ it('requires a numeric value', function () {
+ try {
+ toRoman('foo');
+ assert.fail(noExpectedException);
+ } catch (e) {
+ assert(e instanceof RangeError, noExpectedException);
+ }
+ });
+
+ it('accepts a numeric-like value', function () {
+ const result = toRoman('5');
+ assert.strictEqual(result, 'Ⅴ');
+ });
+
+ it('requires a positive numeric value', function () {
+ try {
+ toRoman(-99);
+ assert.fail(noExpectedException);
+ } catch (e) {
+ assert(e instanceof RangeError, noExpectedException);
+ }
+ });
+
+ it('returns single-characters for small numbers', function () {
+ const expectedLength = 'Ⅹ'.length;
+ for (let i = 1; i <= 12; i++) {
+ const result = toRoman(i);
+ assert.strictEqual(result.length, expectedLength, `input '${i}' -> '${result}' (length ${result.length})`);
+ }
+ });
+
+ it('returns single-glyph entities for small numbers', function () {
+ const expectedLength = 'Ⅰ'.length;
+ for (let i = 1; i <= 12; i++) {
+ const result = toRoman(i, true);
+ assert.strictEqual(result.length, expectedLength, `input '${i}' -> '${result}' (length ${result.length})`);
+ }
+ });
+
+ it('converts correctly', function () {
+ Object.entries(spotChecks).forEach(([num, expected]) => {
+ const result = toRoman(num);
+ assert.strictEqual(result, expected);
+ })
+ });
+
+}); // toRoman
\ No newline at end of file