# Not able to run previous test cases

**URL:** <https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022>\
**Category:** General\
**Tags:** challenge:shell\
**Created:** [March 4, 2025, 6:23pm UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022 "2025-03-04T18:23:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaffikoda](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/kaffikoda/32/6208_2.png) [@kaffikoda](https://forum.codecrafters.io/u/kaffikoda)\
**Post date:** [March 4, 2025, 6:23pm UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022/1 "2025-03-04T18:23:10Z")

</div>

Currently I am on #IP1 but before solving this challenge I refactored my code. I wanted to run cases for #MG5.

I referred to this [Codecrafters test --previous is now available!](https://forum.codecrafters.io/t/codecrafters-test-previous-is-now-available/793) and tried running the below command but was not able to get any results, please let me know where am I going wrong.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/0/0ac721d0468b75e8a0773cd05ecb7cee28066cd1.png)

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [March 4, 2025, 8:58pm UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022/3 "2025-03-04T20:58:55Z")

</div>

Can you try following the instructions here please? [How do I install the CLI? - CodeCrafters](https://docs.codecrafters.io/cli/installation)

Doesn’t look like the CLI is installed on your machine.

---

<div class="post-metadata">

**Author:** ![kaffikoda](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/kaffikoda/32/6208_2.png) [@kaffikoda](https://forum.codecrafters.io/u/kaffikoda)\
**Post date:** [March 5, 2025, 7:43am UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022/4 "2025-03-05T07:43:27Z")

</div>

Hi @rohitpaulk thanks a lot for your help. I was able to run cases but there is one doubt. This command **`codecrafters test --previous`** is also running cases for the current challenge as well.

One thing which I have understood is that when we write **`git push origin master`** that time test cases run from the current challenge to the first challenge.

But when we do **`codecrafters test --previous`** that time it runs from first test case to the current test case. Is the testing of current test case expected?

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/a/a8f93d0fdf336b90979d5252dff148ea9d2b32bb.png)

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [March 5, 2025, 8:29am UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022/5 "2025-03-05T08:29:55Z")

</div>

Hey @kaffikoda Yes, that’s expected!

`codecrafters test --previous` runs all stages **from the first up to and including your current stage** to ensure everything still works as you progress.

If you want the same order as `git push`, simply run `codecrafters test`.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/1/143a1ce30f6aa83703e122cb39cba6d35465b519.png)

---

<div class="post-metadata">

**Author:** ![kaffikoda](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/kaffikoda/32/6208_2.png) [@kaffikoda](https://forum.codecrafters.io/u/kaffikoda)\
**Post date:** [March 6, 2025, 4:47pm UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022/6 "2025-03-06T16:47:50Z")

</div>

Thanks for letting me know. This was super useful.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [March 11, 2025, 4:48pm UTC](https://forum.codecrafters.io/t/not-able-to-run-previous-test-cases/6022/7 "2025-03-11T16:48:49Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
