In creating our own test suites, we only need to invoke npm test and the tests execute as required. How does the command know which test suite to execute, as there may be many? Also, how would we set up our environment so that npm test runs our tests?
Answer
The behavior of npm test is specified in the package.json file that is part of all of our applications. If we look inside this file, we will see the following lines
Notice the line "test": "bin/wdio-test". This specifies to our application that when looking to execute tests, via npm test, we should execute the file located at bin/wdio-test. It’s no surprise then that when executing npm test for this assignment we find the following two lines
> [email protected] test /home/ccuser/workspa
ce/why-test-test-suite
> bin/wdio-test
So to respond to both questions:
The command knows which test suite to specify based on which value it finds corresponding to the “test” key in “scripts”.
We can set up our own tests in our environment by specifying a "test" : "file/path" key/value pair in "scripts"once we have a package.json file for our project.
i am having the same issue…and on a number of lessons in this module. Can this please be looked into because it’s such a struggle to understand what the exercises are talking about when I cannot even reproduce the results.
Is anybody working on this??? 2 years down the line and the same problem still persists. I do understand that security is an issue to watch out for, especially in a coding website, but it should not interfere with the coding flow of students. Some of the code is already frustrating enough, the last thing we need is even more frustrating experiences.
Hey guys, I don’t work here but I find this odd so I’m trying to help…
I am not experiencing this issue in the course so I am thinking maybe the issue:
• has either been fixed,
• maybe is due to the browser you’re using?
I would try to use the site with another browser to start, then with another computer and the same account to try and isolate the problem.
Otherwise, I would write to Codecademy’s customer service directly: if you are paying for this, it should be working. You can go here: Codecademy Help Center and click on My Account, then a chat box will be available to contact them.
If it can be of any help, I am using Chrome since I found Firefox or other browsers had some issues with the lesson’s interface. Not sure if that helps, but stay safe!
had exactly the same issue you experienced. I even checked their solution and it did not show it was different from mine. I had to choose the option to replace my code with the solution code in order to get passed that check point.