ANSWER: Both client and server test results are displayed in the browser, unlike Mocha, where server tests show up in the server spew (which is what I was expecting). Nothing to see here.
// package.js
Package.onTest(function(api) {
api.use([
'tinytest',
'mongo',
'my-package']);
// Using A, B, *or* C below -- no luck running my test on the server
// A
api.addFiles('my-package-tests.js');
// B
api.addFiles('my-package-tests.js', ['client', 'server']);
// C
api.mainModule('my-package-tests.js', 'client')
api.mainModule('my-package-tests.js', 'server')
});
// my-package-tests.js
if (Meteor.isServer) console.log('SERVER')
else if (Meteor.isClient) console.log('CLIENT')
Tinytest.add("simple", function (test) {
test.equal(1, 1);
})
➜ meteor test-packages my-package --port 25111 --release 3.0.4 <<<
=> Errors while collecting tests:
While trying to test package `my-package`:
error: Not a known local package, cannot test
Do you see any errors on the client when running the tests? I’ve sometimes seen this happen, and if I remember correctly it’s been because there was an error on the client.