UNPKG

medic-enketo-xslt

Version:

XSL stylesheets for the Enketo XForm transformation to be run client-side in a web browser

61 lines (53 loc) 1.7 kB
var assert = chai.assert; describe('enketo-client-side-transformer spec', function() { it('should allow assertions', function() { assert.ok(true); }); it('should launch the browser and output some logging', function() { console.log('[console.log()] Testing 1, 2, 3...'); console.error('[console.error()] Testing 1, 2, 3...'); }); }); describe('transformations', function() { var enketo_client_side_transformer; beforeEach(function() { enketo_client_side_transformer = new EnketoClientSideTransformer(); }); [ 'cascading-selects', 'database-object', 'dosages', 'geolocation-test', 'hospital-survey', 'households', 'pictorial-report', 'pregnancy', 'treatments', 'visit-report', ].forEach(function(xform) { it('should be output for ' + xform, function(done) { enketo_client_side_transformer.transform('/base/test/transformation/xforms/' + xform + '.xml', function(transformed) { console.log('[TRANSFORMED] ' + JSON.stringify({ name:xform, content:transformed })); done(); }); }); }); }); describe('EnketoClientSideTransformer', function() { it('should be a function', function() { assert.typeOf(EnketoClientSideTransformer, 'function'); }); describe('instance', function() { var enketo_client_side_transformer; beforeEach(function() { enketo_client_side_transformer = new EnketoClientSideTransformer(); }); describe('#transform()', function() { it('should be available', function() { assert.typeOf(enketo_client_side_transformer.transform, 'function'); }); }); }); });