Tomas Romero
Tomas Romero

Reputation: 8698

How to exit a MeteorJS program from within code?

I need to run tests, and have them exiting the meteor process with a certain exit code, depending on success/failure. I need to do this inside Meteor.startup.

I tried process.exit(1), but only see on the console:

=> Exited with code: 1                        
=> Your application is crashing. Waiting for file change.

I need the process to actually exit with the proper exit code (for example, for acknowledging CI about unsuccessful runs).

How can I achieve this?

I don't want to use Velocity, I'm actually trying to come out with a simpler testing approach that suits my needs for a particular project.

Upvotes: 0

Views: 387

Answers (2)

Xolv.io
Xolv.io

Reputation: 2533

meteor --test is a Velocity command that is built-in to Meteor. You may want to use meteor --once so that Meteor does not restart

Upvotes: 1

Tomas Romero
Tomas Romero

Reputation: 8698

I've found a way:

Running meteor --test lets you exit from within Meteor with process.exit.

Upvotes: 0

Related Questions