You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each task is judged to pass (β) or fail (β) by the result of code tests that runs in the background. Tests can be triggered by saving a file, or by a trigger that listens to specific files for changes.
If a test fails, the first failing test name is returned to the user as a hint to identify the problem.
26
26
@@ -32,19 +32,19 @@ But where does the code for these tests come from?
32
32
33
33
CodeRoad tutorials are stored and loaded using Git, a popular version control system. If you're unfamiliar with Git, think of it as a way to save or load progress from checkpoints called "commits".
In a tutorial, these commits have a standardized order. First you setup the test runner, then the task tests, then the solution. This pattern is similar to a kind of development called βTDDβ or βtest driven developmentβ. Write tests for the problem you want to solve, then save the results when all the tests pass. This pattern can also be used to play out a tutorial like a game: users get a task, then must solve it to continue.
When a tutorial starts, CodeRoad loads git commits from a tutorial up until the first task commit. These commits contain all of the code setup, test runner configuration and tests for the given task.
When a user passes a task, their progress is saved as a commit. Then the next task commit is loaded.
46
46
47
-

47
+

48
48
49
49
Again notice that the user provides the solution and it is not loaded from the tutorial. This allows users to go a little off-road in a tutorial and provide their own solutions.
50
50
@@ -62,7 +62,7 @@ Git provides a number of benefits:
62
62
63
63
If at some point the user is a bit too βoff-roadβ from the solution, the user can always return to the βgolden pathβ by pressing the **reset** button. The reset button reloads the commits up to that point entirely from the tutorial.
0 commit comments