How to check the results of the chai tests on IS&QA projects?

Hi everyone, I’m currently on the information and quality assurance projects and can’t figure out how to see the results of my assert tests. I’ve tried console log and I can’t seem to remember or find it being explained during the curriculum.

Any help is much appreciated. Thanks.

Alright, I figured it out, cant say this is perfect but, to check your results of the chai tests that you will be writing
in the Information Security and Quality Assurance projects on Glitch.

What I did was in the Glitch console was enter this: mocha --ui tdd tests/1_unit-tests.js
Assuming what you want to test is the unit_tests etc…

Although I now in the package.json under “scripts” I added a “test” property with the same value.
mocha --ui tdd tests/1_unit-tests.js

Now in the Glitch console just run npm test. When testing a different file just edit the test entry.

Is there a different way ??

Just noticed that the tests are running in the console on the second project. But not the first one.

5 Likes

Hi, I know it’s been two years since you last posted about this topic, but I wanted to share a more simple method, in case anyone runs into this post while searching on the internet.

I’m currently working on the Information Security and Quality Assurance Projects and had no idea howto check if my Chai tests were passing or not.

It seems like you can simply add this into package.json under "scripts" and then add a "test" property with "mocha tests -u tdd"

The scripts object inside your package.json should look like:

	"scripts": {
		"start": "node server.js",
    "test": "mocha tests -u tdd" 
	}

To see your test run from the terminal, simply enter npm test