I need to determine the name of the Meteor package that a given test file is currently testing, so that I can derive the path to assets. For example, if we're testing fortawesome:fontawesome, the assets will be accessible at /packages/fortawesome_fontawesome/
.
How can I get the name of the very package that TinyTest is testing?
package.js:
Package.onTest(function (api) {
api.use(packageName, where);
api.use(['tinytest', 'http'], 'client');
api.addFiles('test.js', 'client');
});
test.js:
var packageName = ???;
HTTP.get('/packages/' + packageName.replace(':', '_') + '/fonts/fontawesome-webfont.woff');