UNPKG

ghost-storage-cloudinary-v2

Version:
24 lines (20 loc) 774 B
'use strict'; const chai = require('chai'), expect = chai.expect, path = require('path'), RetinaJS = require(path.join(__dirname, '../../../plugins')).RetinaJS; describe('sanitize', function () { it('should remove retinajs identifier', function (done) { const tests = [ ['input.ext', 'input.ext'], ['foo.ext', 'foo@1x.ext'], ['encoded.ext', 'encoded%403x.ext'], ['foo@2x.ext', 'foo@2x@1x.ext'] ], retinajs = new RetinaJS(function () {/* Do nothing */ }, { upload: { public_id: 'foo' } }, { baseWidth: 1 }); for (const [expected, input] of tests) { expect(retinajs.sanitize(input)).to.equal(expected); } done(); }); });