在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:sleepyfox/coffeescript-koans开源软件地址:https://github.com/sleepyfox/coffeescript-koans开源编程语言:CoffeeScript 100.0%开源软件介绍:CoffeeScript KoansThe goal of the CoffeeScript koans is to teach you CoffeeScript programming through actually doing it, in a test-first fashion. When you first run the Koans, you'll be presented with a run-time error and a stack trace indicating where the error occurred. Your goal is to make the error go away. As you fix each error, you should learn something about the CoffeeScript language and functional programming in general. Your journey towards CoffeeScript enlightenment starts in the Koans folder with the AboutExpects.coffee file. These Koans will be very simple, so don't over-think them! As you progress through more Koans, more and more CoffeeScript syntax will be introduced which will allow you to solve more complicated problems and use more advanced techniques. Getting StartedThis project requires Node.js - if you haven't already installed it I would recommend installing the Node Version Manager - NVM - and using that to install Node. Install dependencies by using npm from the command line:
Running the KoansStart with copying the file koans/AboutShould.coffee to the completed-koans/ folder. Run the tests with Mocha on the command line:
You should see the following output:
You'll see that one of the tests is failing, and that the other 4 have been temporarily disabled (marked as 'pending'). Edit the AboutShould.coffee file (your copy in the completed-koans/ folder) with the editor or IDE of your choice and follow the directions to fix the problem in the first test. When you think you've fixed the problem, run the tests again.
When that test passes, enable the next pending test. Rinse and repeat until all tests turn green, simples :-) When you're done with AboutShould.coffee, copy another file from the koans/ folder to the completed-koans/ folder and start work on that. I would suggest trying them in the following order, but it is not prescriptive:
If you want to just test a single test file, you can do it like this: (remember to add in the name of your file)
If you want mocha to watch your files for changes and rerun the tests automagically when you save changes to a test file, simply use:
Have fun, and I hope you enjoy playing with CoffeeScript! Endorse this projectTo say 'thanks' please endorse this project on Coderwall by clicking the button below: Or, if you happen to be in London, please drop by for a chat and buy me a beer! Inspirations & thanks
License (legal deed)The text below is a human-readable summary of (and not a substitute for) the license, contained in the LICENSE file. Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) You are free to:
The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms:
Notices: You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论