Browse Source

Restructure test/ for meteor #1607

pull/1845/merge
jlukic 10 years ago
parent
commit
8afab4af8d
4 changed files with 23 additions and 21 deletions
  1. 14
      meteor/tests/test_fonts.js
  2. 4
      tasks/admin/templates/package.js
  3. 10
      test/meteor/assets.js
  4. 16
      test/meteor/fonts.js

14
meteor/tests/test_fonts.js

@ -1,14 +0,0 @@
// 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();
});
});
});

4
tasks/admin/templates/package.js

@ -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);
});

meteor/tests/test_images.js → test/meteor/assets.js

@ -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
test/meteor/fonts.js

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