UNPKG

scrabble

Version:

Scrabble is a lightweight module that lets you cheat on a wide range of word games, most notably, the eponymous. Pass your letters into Scrabble as a string and it will return an array of all the possible combinations of those letters that comprise words

17 lines (13 loc) 550 B
const sc = require('./scrabble.js') const undefinedInputs = sc(undefined) if (undefinedInputs !== 'Your input is undefined.') { throw new Error('sc not recognizing undefined inputs') } const nonStringInputs = sc(76589) if (nonStringInputs !== 'Your input is not a string.') { throw new Error('sc not recognizing non string inputs') } const nonAlphabeticCharacters = sc('p4p%oi&ajsdb') if (nonAlphabeticCharacters !== 'Your input contains non alphabetic characters.') { throw new Error('sc not recognizing non alphabetic characters') }