- Create a directory for the day you are working on named day{DAY_NUMBER}. Inside of the new directory, create the following files:
index.tscode.input.txtthe input.test_input1.txttest input for the first part of the challenge.test_input2.txttest input for the second part of the challenge.
- Use the helper functions from
read_write/read.ts:solveTest1,solveTest2,solveReal1,solveReal2.
The code can be tested. In order for the tests to work for a day{DAY_NUMBER} directory make sure that:
- It has the structure suggested at How to develop - 1
- The
index.tsfile exports the solutions for each part of the challenge (naming themsolve1andsolve2). - Export two variables,
expectedResultPart1andexpectedResultPart2which represent the expected results of the challenge. Can be undefined at the start of the challenge. - There is a list of directories in
tests/index.test.ts. Tests will be created for each directory. Make sure that the newly created directory is part of that list.
- Run
npm install - Navigate to the directory of your choice.
- Run
npx nodemon index.ts
- Run
npm test.