FAQ: TDD Feature-Level Tests - Feature Test I: Passing

Community%20FAQs%20on%20Codecademy%20Exercises

This community-built FAQ covers the “Feature Test I: Passing” exercise from the lesson “TDD Feature-Level Tests”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn Testing for Web Development

FAQs on the exercise Feature Test I: Passing

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

“Run your test suite in the terminal.”

What do you type into the terminal to run “user-visits-root.js”. node user-visits-root.js did not work.

You can type

npm test

to run the test suite. See this lesson for detail.

Why is no HTML boilerplate required for this lesson? Has it already been included elsewhere in the project? How can it pass the test without a DOCTYPE or etc?

The file system provided includes that index.html file in the same project, which also mentions the doctype by its extension. I understand your question beyond that though, here’s my reasoning:

I used a simple PWD command in the bash terminal to determine we are working in

/home/ccuser/workspace/tdd-feature-test-pass-feature-test-i

which includes all subfiles we can see in the file system for the lesson.

Then, the command

browser.url('/');

looks for a root directory in our project. I am a bit unsure how it’s able to understand that this HTML file is the root… is it because it’s the only HTML file in the project? I am unfamiliar with Phantom so feel free to correct me here.

I also believe it can only run on HTML files so we do not need to precise the doctype through the request, where we provide an URL anyway, but that’s just my assumption :wink:

It’s been a long time since I covered this, so I’ve forgotten it all now…

Perhaps as you suggest with it being a .html it knows how to process it. It just strikes me as odd that it doesn’t need a <head> or a <body> tag even!

You queried about how does it know where the index.html file is located? I think it’s because of how Express is configured in app.js to /public

1 Like