Can I run all my *.test.js and *.app-test.js tests in a single test run?


#1

I have a collection of app and unit tests. If I run

'meteor test --once … ’ then the *.test.js files are run only. I have a test that fails in here and I see it fail. However, I don’t see it running the app-test.js files (which it isn’t supposed to).

‘meteor test --once --full-app’ only seems to run the *.app-test.js files. I have a failing unit test, and I definitely don’t see any failures.

I’m looking at automating my tests, and I’d like to run a single cli line to run all my tests. Is that possible?

Still learning, so I may have done something weird.

Thanks!


#2

Not sure if this is your issue… but…

If you’re like me you logically started out by putting your tests in a folder called “tests”

Makes way too much sense right?

When using the Meteor test command you don’t want to put any tests in a folder calls “tests”… this is like a trap. I wish they picked a different name since putting your tests in a folder called “tests” is very logical but will drive you mad since nothing will happen. LOL…

From the guide:

  • The Meteor build tool and the meteor test command ignore any files located in any tests/ directory. This allows you to put tests in this directory that you can run using a test runner outside of Meteor’s built-in test tools and still not have those files loaded in your application.

#3

No, I put my unit tests in a /unittest/ directory.

I’m starting to think I just misunderstood the testing intention. I’m looking at the following bits on https://guide.meteor.com/testing.html:

Blockquote
The primary way to test your application in Meteor is the meteor test command.

Does eagerly load any file in our application (including in imports/ folders) that look like .test[s]., or .spec[s].

Which isn’t the same as:

Blockquote
Additionally, Meteor offers a “full application” test mode. You can run this with meteor test --full-app.

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

So I guess there’s one style of testing for one type of testing and a different set for other types of test. So if you want (for CI) to run both tests, you apparently need to run two commands.

I don’t think that’s a problem, just something I didn’t initially understand.