mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
As demonstrated in https://github.com/meteor/meteor/issues/9276.
This test wouldn't have caught the regression in the previous solution
since the lack of a TTY in the `self-test` test harness caused the tests
themselves to take the path through `shell-server`'s `evaluateAndExit`
logic, which didn't use the `global` scope in the same way as the
interactive shell. That is no longer the case as of e0682c553d.
17 lines
520 B
JavaScript
17 lines
520 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
|
|
Meteor.startup(() => {
|
|
Meteor.checkMeFromShell = "oky dok";
|
|
});
|
|
|
|
// Create a global underscore variable which should be preserved,
|
|
// not overriden by the special REPL `_` variable, when a command
|
|
// is executed on the shell. The method will allow the test to call
|
|
// back and confirm it's still set.
|
|
_ = {_specialUnderscoreTestObject: true };
|
|
Meteor.methods({
|
|
"__meteor__/__self_test__/shell-tests/underscore"() {
|
|
return typeof _ === "object" && Object.keys(_);
|
|
}
|
|
})
|