Clone this repo with the command:
git clone https://github.com/ZackDeRose/advent-of-code-starter.git
For each puzzle of the advent of code, this starter gives you:
- a
.ts
file for your solution (insrc/day-X
) - a
.spec.ts
file for testing (also insrc/day-X
) - a
<a/b>.test.txt
file for your test data-set (indata/day-X
) - a
<a/b>.txt
file for you to paste your full dataset (also indata/day-X
).
The starting point we've generated will allow you to use the commands provided to pass the appropriate data set when running/testing your solution.
Given you're on the first puzzle of day 1, here are the commands available:
npx nx day-1-a
This will run your code in a node context against the full data set provided in data/day-1/a.txt
- the
--watch
option can be added to add file watching (i.e.:npx nx day-1-a --watch
) - the
--test-data
option can be added to run against your test data set found in the provideddata/day-1/a-test.txt
(i.e.:npx nx day-1-a --test-data
); - these options can be combined (i.e.:
npx nx day-1-a --test-data --watch
)
npx nx test-day-1-a
This will run the test you can find in src/day-1/a.spec.ts
.
The generated code in this file will already import and run your solution from src/day-1/a.ts
against the data found in data/day-1/a-test.txt
, but you are welcome to adjust this test code as needed.
- the
--watch
option can be used to turn on file-watching for your test.
✨ This workspace has been generated by Nx, a Smart, fast and extensible build system. ✨
Visit the Nx Documentation to learn more.