Ghost/ghost/api-framework/test/util/options.test.js
Daniel Lockyer 348924d431 Updated API framework debug and test names
- these tests have moved from `core/` so the names are no longer
  relevant
2022-08-11 17:44:59 +02:00

24 lines
873 B
JavaScript

const optionsUtil = require('../../lib/utils/options');
describe('util/options', function () {
it('returns an array with empty string when no parameters are passed', function () {
optionsUtil.trimAndLowerCase().should.eql(['']);
});
it('returns single item array', function () {
optionsUtil.trimAndLowerCase('butter').should.eql(['butter']);
});
it('returns multiple items in array', function () {
optionsUtil.trimAndLowerCase('peanut, butter').should.eql(['peanut', 'butter']);
});
it('lowercases and trims items in the string', function () {
optionsUtil.trimAndLowerCase(' PeanUt, buTTer ').should.eql(['peanut', 'butter']);
});
it('accepts parameters in form of an array', function () {
optionsUtil.trimAndLowerCase([' PeanUt', ' buTTer ']).should.eql(['peanut', 'butter']);
});
});