Array of function names to adds to global when infect() is called.
Helper function that adds the supplied function to the before() and after() hook
provided by mocha. This is provided in case you want to override the behavior of the
before() and after() hook that is used by mocha-subject.
NOTE: Mocha rebuilds its before() and after() function after every test run
so you must take care not to capture these variables and re-use it across different
run of the test because it will produce unpredictable result. These two functions
also helps in this regard. (Re-retreiving the value of global.before and
global.after hook after every run.)
Adds subject() and property() method to global scope so it can be used without
referencing mocha-subject.
Removes all functions added by infect() from global scope.
Adds the given object to current mocha test context using the specified name in a
before hook and removes it afterwards in an after hook.
TODO: Is there a way to track subjects hierarchy without modifying the context? storing states ourselves is probably not a good idea.
Take property name from the nearest subject object and adds it to current mocha
test context using the specified key (or the same name as the property if key is
not specified.)
subject.js - Subject-style setups/teardowns.