Transcript
00:00 One of the common global dependencies is a dependency on the environment, specifically on the environment variables. Here, let me show you. We've got this emitter class here that looks extremely similar to the emitter from the exercise block on functions. But this emitter
00:15 is a little special. See, it has logging added. So whenever we add a listener or emit an event, we're going to print the respective console message for the developer to know. But we don't want to have that logging all the time. Especially, we don't want to have it in production. So to
00:30 account for that, we have this is development utility function. And all it does is basically checks the value of node environment variable, whether it equals to development. Here, you access the global process object in Node.js, its environment variables, and the one that's
00:45 called node environment. In this exercise, your task is to test this emitter functionality, specifically its logging functionality. And you will be using different environment variable values to do that because there's actually two intentions behind this logging. First one is that you should
01:00 print messages when running development. But the second one is that you mustn't print any messages if you run in production. And it's going to be tricky because otherwise, you'd be able to provide this environment variable right here on the test command. But since you need to test these two
01:15 different scenarios, it will be a little different approach. So explore it and see me in a bit.