UNPKG

jaywalk

Version:
23 lines 735 B
"use strict"; var test = require('blue-tape'); var index_1 = require('../index'); test('transform', function (t) { t.test('uses', function (t) { var schema = new index_1.Types.String({ uses: [ new index_1.Types.Transform({ name: 'toLower', transform: function (str) { return str.toLowerCase(); } }) ] }); var validate = index_1.compile(schema); t.test('should validate with transformation', function (t) { return validate('HEY') .then(function (value) { t.equal(value, 'hey'); }); }); }); }); //# sourceMappingURL=transform.spec.js.map