mirror of
https://github.com/correl/elm.git
synced 2024-11-25 03:00:06 +00:00
Add "watch" command to all exercises
This commit is contained in:
parent
d76d7ecb7b
commit
03d20b5005
34 changed files with 47 additions and 0 deletions
|
@ -45,6 +45,8 @@ Please keep the following in mind:
|
||||||
- The recommended workflow when working on an exercise is to first create the implementation and test files, `ExerciseModuleName.elm` and `tests/Tests.elm`. You'll likely want to copy one of the existing exercise directories as a quick start.
|
- The recommended workflow when working on an exercise is to first create the implementation and test files, `ExerciseModuleName.elm` and `tests/Tests.elm`. You'll likely want to copy one of the existing exercise directories as a quick start.
|
||||||
- Test the new exercise directly by running `npm test` from the exercise directory.
|
- Test the new exercise directly by running `npm test` from the exercise directory.
|
||||||
|
|
||||||
|
- Automatically run tests again when you save changes by running `npm run watch` from the exercise directory.
|
||||||
|
|
||||||
- Once the implementation of the exercise is complete, rename `ExerciseModuleName.elm` to `ExerciseModuleName.example.elm` and create the template `ExerciseModuleName.elm`.
|
- Once the implementation of the exercise is complete, rename `ExerciseModuleName.elm` to `ExerciseModuleName.example.elm` and create the template `ExerciseModuleName.elm`.
|
||||||
|
|
||||||
- Make sure everything is good to go by running all tests with `bin/build.sh`.
|
- Make sure everything is good to go by running all tests with `bin/build.sh`.
|
||||||
|
|
|
@ -17,3 +17,9 @@ Execute the tests with:
|
||||||
```bash
|
```bash
|
||||||
$ npm test
|
$ npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Automatically run tests again when you save changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run watch
|
||||||
|
```
|
||||||
|
|
|
@ -8,6 +8,14 @@ $ npm test
|
||||||
|
|
||||||
## Hints and tips
|
## Hints and tips
|
||||||
|
|
||||||
|
### Watch for changes
|
||||||
|
|
||||||
|
Automatically run tests again when you save changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run watch
|
||||||
|
```
|
||||||
|
|
||||||
### Coding the exercise
|
### Coding the exercise
|
||||||
|
|
||||||
The README.md for each exercise gives a general description, but the Elm test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running the test command before you have written anything and see if the error messages give you an idea of where to start.
|
The README.md for each exercise gives a general description, but the Elm test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running the test command before you have written anything and see if the error messages give you an idea of where to start.
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "elm-package install -y",
|
"postinstall": "elm-package install -y",
|
||||||
|
"watch": "elm-test --watch",
|
||||||
"test": "elm-test"
|
"test": "elm-test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Reference in a new issue