Loading
Current section: Globals 5 exercises
Problem

Global methods

Loading exercise

Transcript

00:00 Here you have a printServerUrl function that accepts a server and then constructs a URL from server's host and attaches an optional port to that URL, so that it could print to the console that the server is listening at a particular address. So the main purpose of this function is precisely this console.log call.

00:18 In this exercise you will be testing that functionality, but since the console is a global object, you would have to find some way to spy when its log method is being called and whether it's being called with the right arguments. That sounds awfully familiar, doesn't it? I will leave it up to you to figure out the exact details, and see you on the other side.