LOGOCOMP1531 - Practice Exam

Q10. My Cat's Condition (15 Marks)

Your cat has been acting strangely, dashing through rooms, meowing at shadows, and switching moods in a blink. As a watchful owner, you've started noting its behaviors, hoping to decode the mystery. Now it's time to analyze the actions and uncover your cat's current mood and condition.

To make this process easier, we've created the recordActions() function in q10/cat.ts, however there are currently no tests or guarantees that this works.

Task

Your task is to write at most three more HTTP tests (excluding the given test) for the recordActions() function in q10/cat.test.ts for 100% statement coverage score.

NOTE: Each individual test case in test.each counts toward the maximum test limit.

Testing

You can run the following command to start the server with coverage report.

npm start

You can use the following command to run your tests:

npm run test

Marking

When you think your program is working, you can run some simple automated tests:

  • statement coverage: npm run start and in a separate process npm run test

Submission

The submission will only collect the q10/cat.test.ts file. All other files are replaced in automarking.

When you've finished working, submit your answer by running:

submit --question 10

If no submissions have been made for a question, we will take the saved file/s from your working directory.