I added an offline test mode to leetgo in my fork, ericklucioh/leetgo (https://github.com/ericklucioh/leetgo), so questions can be tested
later without depending on the LeetCode API at test time.
What changed:
- leetgo pick now stores local offline metadata for the generated question.
- The saved data includes:
- slug
- frontend id
- language
- output directory
- generated filenames
- question content
- translated content
- question metadata
- A new offline test flow was added:
- Offline testing works only with local artifacts already generated by pick.
- The offline flow still supports -t to run a subset of cases.
Examples:
leetgo pick 1
leetgo test -O last
leetgo test -O last -t 1-3
Current behavior and limitations:
- Offline state is stored per ProjectRoot(), so it is tied to the repository where pick was run.
- Because of that, the offline cache is not automatically shared across different clones or forks.
- Offline mode does not support system design questions yet.
- If required metadata is missing, leetgo pick must be run again.
- -O cannot be combined with --local, --both, --submit, or --force.
I added an offline test mode to leetgo in my fork, ericklucioh/leetgo (https://github.com/ericklucioh/leetgo), so questions can be tested
later without depending on the LeetCode API at test time.
What changed:
Examples:
leetgo pick 1
leetgo test -O last
leetgo test -O last -t 1-3
Current behavior and limitations: