Skip to content

Commit

Permalink
Restructure test/ for meteor Semantic-Org#1607
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jan 12, 2015
1 parent db25fb6 commit 8afab4a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
14 changes: 0 additions & 14 deletions meteor/tests/test_fonts.js

This file was deleted.

4 changes: 2 additions & 2 deletions tasks/admin/templates/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Package.onTest(function(api) {
], where);

api.addFiles([
'meteor/tests/test_fonts.js',
'meteor/tests/test_images.js',
'test/meteor/fonts.js',
'test/meteor/assets.js',
], where);
});
10 changes: 5 additions & 5 deletions meteor/tests/test_images.js → test/meteor/assets.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
var images = [
var assets = [
'dist/themes/default/assets/images/flags.png',
];

// Check that the font files are downloadable. Meteor places assets at /packages/<packageName>/.
images.forEach(function (path) {
assets.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 {
}
else {
test.isTrue(result.content.length > 10000, 'Image ' + path + ' could not be downloaded');
}

done();
});
});
});


16 changes: 16 additions & 0 deletions test/meteor/fonts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Check that the font files are downloadable. Meteor places assets at /packages/<packageName>/.
['eot', 'otf', 'svg', 'ttf', 'woff']
.forEach(function (extension) {
Tinytest.addAsync(extension + ' fonts are shipped', function (test, done) {
HTTP.get('/packages/semantic_ui/dist/themes/default/assets/fonts/icons.' + extension, function callback(error, result) {
if (error) {
test.fail({message: 'Font failed to load'});
}
else {
test.isTrue(result.content.length > 10000, extension + ' font could not be downloaded');
}
done();
});
});
})
;

0 comments on commit 8afab4a

Please sign in to comment.