# Is there a way to retest refactored code on earlier sub-challenges

**URL:** <https://forum.codecrafters.io/t/is-there-a-way-to-retest-refactored-code-on-earlier-sub-challenges/13228>\
**Category:** General\
**Tags:** challenge:bittorrent\
**Created:** [July 8, 2025, 5:38am UTC](https://forum.codecrafters.io/t/is-there-a-way-to-retest-refactored-code-on-earlier-sub-challenges/13228 "2025-07-08T05:38:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhruvgupta1999](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/dhruvgupta1999/32/14154_2.png) [@dhruvgupta1999](https://forum.codecrafters.io/u/dhruvgupta1999)\
**Post date:** [July 8, 2025, 5:38am UTC](https://forum.codecrafters.io/t/is-there-a-way-to-retest-refactored-code-on-earlier-sub-challenges/13228/1 "2025-07-08T05:38:35Z")

</div>

I refactored my code and it fails on the sub-challenge “download file” in Torrent client project.  
I want to retest it on the earlier sub-challenges test cases like “download a file piece”.

I am using windows so unable to use the codecrafter CLI to run the specific tests.  
I use git push to test my code.  
Is there a way to retest on the earlier sub-challenges ?

---

<div class="post-metadata">

**Author:** ![i27ae15](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/i27ae15/32/3295_2.png) [@i27ae15](https://forum.codecrafters.io/u/i27ae15)\
**Post date:** [July 8, 2025, 9:45am UTC](https://forum.codecrafters.io/t/is-there-a-way-to-retest-refactored-code-on-earlier-sub-challenges/13228/3 "2025-07-08T09:45:59Z")

</div>

You can install the CLI through WSL : [Install WSL | Microsoft Learn](https://learn.microsoft.com/en-us/windows/wsl/install)

Then `codecrafters test --previous`
