With the first few exercises, you will get a skeleton file with the exported modules. For later ones, you can find more information about modules in the node documentation.
For running tests, install
Only the first test will be executed, all the others have been marked pending using
As you keep solving the exercise, one by one change all
describe respectively to run all the tests.
See Test Driven Development (TDD) to know more about this approach.
When all tests pass, you are ready to submit!
Visual Studio on Windows
You are free to skip this section if you are not using
Visual Studio on
Install Visual Studio Express 2013 for web. This will include the IDE and web development tools.
- Download the Exercism.io Visual Studio Template from GitHub by clicking the Download Zip button on the page.
- Unzip the template into your exercises directory, for example
- Install the Exercism CLI
- Open a command prompt to your exercise directory
- Add your API key to exercism
exercism configure --key=YOUR_API_KEY
- Configure your source directory in exercism
exercism configure --dir=C:\src\exercises
Fetch your first exercise
- Open the Exercism solution in Visual Studio
- Click on Show All Files in Solution Explorer (See below)
- The exercise you just fetched will appear greyed out. Right click on the folder and Include In Project
- Get coding...
You can run the unit tests from a node.js command line using the batch file in the project.
If you do not see any output from running the tests, you are likely not in a Node.js command prompt.
Setting Up a Linter
** Note: This section is completely optional **
A linter is like a tester for your code's style and formatting. In some languages there are many acceptable styles, and using a linter allows you to be internally consistent (e.g. Ruby), or adhere to one of many common styles. In other languages there are fewer choices, and a linter allows programmers to look at code from a great variety of sources and still feel at home (e.g. Go). You can read more here.
To get started using ESLint, follow the instructions here. Once you have ESLint installed, you'll be able to lint your code with a simple
eslint [options] [file|dir]* command. Eg, if you're in the hello-world directory,
eslint . would lint all files in that directory.