Understanding test --full-app mode

Can someone help me and shed some light over what is actually meant when the guide says about full app test mode:

This is similar to test mode, with key differences:

  • It loads test files matching .app-test[s]. and .app-spec[s]..

My feeble brain interprets this to mean that these “test files” would not be loaded otherwise, which would indicate that they are in the tests directory. But if I place a file called something.app-tests.js in my tests directory, it is still not loaded when I run meteor test --full-app

So what does this feature actually do?

And second question: Why is Meteor.isTest not true when I run meteor test --full-app ?

(This is all with 1.3.2.4 btw)

…to answer myself for part two of the question: There is also Meteor.isAppTest (which gets a total of 2 (two!) hits on Google), so apparently Meteor.isTest should be taken as isUnitTest.

Part one of the question still stands.

1 Like

You need to place your tests in a directory that is not named tests, because historically the tests folder is ignored by Meteor, which unfortunately didn’t change with the 1.3 release.

Sorry, but I am still not getting it :slight_smile: !

AFAIK if I place a file called something.app-tests.js outside of /tests, it gets loaded. Always. If I am in test mode or not.

There existence of test --full-app must mean that there is a way to have some files loaded in test mode that are not loaded otherwise, no??

You need to place the tests inside a folder:

  • under /imports/
  • not in a tests/ folder

In my case, with 1.3.2.4, if I place my *.app-test.js files under imports, they aren’t seen by the test driver… which happens to be dispatch:mocha-phantomjs.

Currently works if I put the file under /server.

meteor test is broken in the 1.3.2.x releases. It will work again with 1.3.3. See issue https://github.com/meteor/meteor/issues/6831. So for now you would use 1.3.1.

1 Like

I didn’t read about that anywhere in the documentation. How one is supposed to know that? I think it should be well explained in the testing guide (and in the Api Docs, where currently even the Meteor.isTest flag is undocumented).

That’s why I posted it here when I discovered it.
I guess we are free to submit a PR on the docs, but I am too stressed out at the moment…