Browse Source

simple test files to ship a css pacakge with all UI

pull/1607/head
Luca Mussi 10 years ago
parent
commit
761cc4f19b
3 changed files with 73 additions and 0 deletions
  1. 14
      meteor/tests/test_fonts.js
  2. 20
      meteor/tests/test_images.js
  3. 39
      package.js

14
meteor/tests/test_fonts.js

@ -0,0 +1,14 @@
// Check that the font files are downloadable. Meteor places assets at /packages/<packageName>/.
['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();
});
});
});

20
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/<packageName>/.
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();
});
});
});

39
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);
});
Loading…
Cancel
Save