diff --git a/meteor/tests/test_fonts.js b/meteor/tests/test_fonts.js new file mode 100644 index 000000000..40c208162 --- /dev/null +++ b/meteor/tests/test_fonts.js @@ -0,0 +1,14 @@ +// Check that the font files are downloadable. Meteor places assets at /packages//. +['eot', 'otf', 'svg', 'ttf', 'woff'].forEach(function (ext) { + Tinytest.addAsync(ext + ' fonts are shipped', function (test, done) { + HTTP.get('/packages/semantic_ui/dist/themes/default/assets/fonts/icons.' + ext, function callback(error, result) { + if (error) { + test.fail({message: 'Font failed to load'}); + } else { + test.isTrue(result.content.length > 10000, ext + ' font could not be downloaded'); + } + + done(); + }); + }); +}); \ No newline at end of file diff --git a/meteor/tests/test_images.js b/meteor/tests/test_images.js new file mode 100644 index 000000000..0b87a8e5f --- /dev/null +++ b/meteor/tests/test_images.js @@ -0,0 +1,20 @@ +var images = [ + 'dist/themes/default/assets/images/flags.png', +]; + +// Check that the font files are downloadable. Meteor places assets at /packages//. +images.forEach(function (path) { + Tinytest.addAsync('image ' + path + ' is shipped', function (test, done) { + HTTP.get('/packages/semantic_ui/' + path, function callback(error, result) { + if (error) { + test.fail({message: 'Image failed to load'}); + } else { + test.isTrue(result.content.length > 10000, 'Image ' + path + ' could not be downloaded'); + } + + done(); + }); + }); +}); + + diff --git a/package.js b/package.js new file mode 100644 index 000000000..ed737abc2 --- /dev/null +++ b/package.js @@ -0,0 +1,39 @@ +Package.describe({ + name: 'semantic:ui', + summary: 'Semantic empowers designers and developers by creating a shared vocabulary for UI.', + version: '1.0.1', + git: 'git://github.com/Semantic-Org/Semantic-UI.git#1.0' +}); + +var where = 'client'; // Adds files only to the client + +Package.onUse(function(api) { + api.versionsFrom('1.0'); + + api.addFiles([ + 'dist/semantic.css', + 'dist/semantic.js', + 'dist/themes/default/assets/fonts/icons.eot', + 'dist/themes/default/assets/fonts/icons.otf', + 'dist/themes/default/assets/fonts/icons.svg', + 'dist/themes/default/assets/fonts/icons.ttf', + 'dist/themes/default/assets/fonts/icons.woff', + 'dist/themes/default/assets/images/flags.png', + ], where); +}); + +Package.onTest(function(api) { + api.use([ + 'tinytest', + 'http', + 'semantic:ui' + ], where); + api.use([ + 'semantic:ui' + ], 'server'); + + api.addFiles([ + 'meteor/tests/test_fonts.js', + 'meteor/tests/test_images.js', + ], where); +});