# Can i test a previous stage?

**URL:** <https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514>\
**Category:** General\
**Created:** [May 26, 2024, 6:08pm UTC](https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514 "2024-05-26T18:08:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshat1998](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/akshat1998/32/465_2.png) [@akshat1998](https://forum.codecrafters.io/u/akshat1998)\
**Post date:** [May 26, 2024, 6:08pm UTC](https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514/1 "2024-05-26T18:08:51Z")

</div>

Is there a way, i can test a specific previous stage?

---

<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:** [May 26, 2024, 10:28pm UTC](https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514/2 "2024-05-26T22:28:52Z")

</div>

@akshat1998 whenever you pass a stage, we do run tests for all previous stages - does that help?

At the moment there’s no way to trigger tests for earlier stages on-demand if you’re failing the current stage.

---

<div class="post-metadata">

**Author:** ![akshat1998](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/akshat1998/32/465_2.png) [@akshat1998](https://forum.codecrafters.io/u/akshat1998)\
**Post date:** [May 27, 2024, 5:50pm UTC](https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514/3 "2024-05-27T17:50:35Z")

</div>

@rohitpaulk , yes that is helpful.  
I refactored code, and wanted to test for existing passed stages, and it was testing for the next stage (the current unlocked). Because the first test is for the current stage and then for previous stages test, run i got confused.

But since, previous stages tests also run later, it helped.  
Thanks.

---

<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:** [August 8, 2024, 12:46pm UTC](https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514/4 "2024-08-08T12:46:14Z")

</div>

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

---

<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:** [August 8, 2024, 12:46pm UTC](https://forum.codecrafters.io/t/can-i-test-a-previous-stage/514/5 "2024-08-08T12:46:43Z")

</div>

For anyone stumbling upon this, we now support `codecrafters test --previous`: [Codecrafters test --previous is now available!](https://forum.codecrafters.io/t/codecrafters-test-previous-is-now-available/793)
