Hide
In this article
Overview
HackerRank Tests allows you to hide your test cases for the Front end, Back End, and Full Stack question types. This article will walk you through the process of adding Hidden Test Cases to your project file.
Steps to Add Hidden Test Cases
- In the “Setup Project” step of question creation, you can add test case files you intend to hide from the candidate inside the project and declare its path inside the Hackerrank.yml file.
- On clicking the “Validate and save” button, the question will be validated for any discrepancies in the hidden test case declaration.
- If the read-only files or hidden files are detected in the project, the candidate will see an instruction file PROJECT_FILES_INSTRUCTIONS.md which would read:
- Read-only Files
The following files are marked read-only. You cannot edit these files in the editor; however, it is possible from the terminal. You must not modify or delete these files because doing so results in a zero score.
* src/App.test.js
-
- Hidden Files
The following files are not part of the project while attempting, and we add these files when scoring your submissions. You must not create new files with the same name because we will overwrite your changes.
* src/App.hidden.test.js
- During a candidate session, the hidden test cases files will not be downloaded into the IDE to ensure candidates are not able to access the files. “Run test” by the candidate will not display if the hidden test cases passed or not to the candidate.
- After the candidate submits the attempt, the scoring will include these hidden files for evaluation.
- When an evaluator checks the candidate report, all the test cases will be displayed, including hidden test cases.
- If the evaluators decide to review the candidate submission in the IDE, the hidden test cases would be present in the IDE, and “Run Test” will show if the solution passed all test cases, including the hidden test cases.