{"_id":"5702ba2fd4a89736004f295f","version":{"_id":"559b65bd8b04e90d00702d57","project":"559b65bd8b04e90d00702d54","__v":6,"createdAt":"2015-07-07T05:38:05.890Z","releaseDate":"2015-07-07T05:38:05.890Z","categories":["559b65be8b04e90d00702d58","55a46e7468c7e20d0036d4d1","55a4971be6c2470d002a6483","55a4a690e10ba50d00b40bba","55a4bcf31a5f991700a94066","56cf5c8d336aa60b0086a40d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":4,"category":{"_id":"559b65be8b04e90d00702d58","version":"559b65bd8b04e90d00702d57","pages":["559b65bf8b04e90d00702d5a","55a46241ffd44e0d00fca056","55a46f45e75ca60d00a39323","55a470b768c7e20d0036d4d6","55a4a758dad9d00d0071fcba","55b6b6276127b12500364560","55baf505d0736b3100bf1033","55c25ef1f2cff20d006d0b8a","56269a8b44c87f0d00fe6378","56498f62f176080d000c78ac","566f59c4fc3abb0d0020fcd5","567cd2228eb5b20d0021059d"],"project":"559b65bd8b04e90d00702d54","__v":12,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-07T05:38:06.409Z","from_sync":false,"order":0,"slug":"chimpjs","title":"Chimp.js"},"project":"559b65bd8b04e90d00702d54","user":"55a4738a68c7e20d0036d4de","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-04T19:02:07.141Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Follow the [Installation](doc:installation) instructions here.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Develop\"\n}\n[/block]\nTo start developing using Jasmine, you have to start Chimp with the `--jasmine` flag like this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chimp --jasmine --watch\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nChimp will watch your features directory for any `.js` files and rerun any `describe`/`it` blocks  that contain the string `:::at:::watch`. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"describe('Chimp Jasmine', function() {\\n  describe('Page title', function () {\\n    it('should be set by the Meteor method @watch', function () {\\n      browser.url('http://www.google.com');\\n      expect(browser.getTitle()).toEqual('Google');\\n    });\\n  });\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"features/example_spec.js\"\n    }\n  ]\n}\n[/block]\nMake sure that your spec files end with \"_spec\", \"-spec\" or \"Spec\".\n\nBy default, Chimp starts a Google Chrome browser window. This is where your specs will run and you can use this window to see the automation as it happens. Chimp also ensures the same window will remain open between your specs rerunning so you won't get an annoying window popup. \n\nThe watch mode is designed to keep you focused on the task at hand. The idea is you work on a scenario through to completion, and then move the `@watch` tag to the next spec you are working on.\n\nYou can see this mode in action in the [demo video](http://chimpjs.com)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Test\"\n}\n[/block]\nYou've now finished your tasks and are ready to commit your code. If you want to run the build locally you can run all the tests using this command:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chimp --jasmine\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nChimp recognizes that you're not in watch mode and will run all the specs.\n\nThis same command can also be used on CI servers.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Learn more\"\n}\n[/block]\nYou can find more info on the [Jasmine support](doc:jasmine-support) page.\n\n---\n\n<a href=\"http://quality.xolv.io/?utm_source=XolvOSS&utm_medium=OSSDocs&utm_content=ChimpRM-Footer&utm_campaign=QFLaunch\"><img src=\"https://files.readme.io/764e495-qualityfasterbook-commas.small.png\" width=\"200\" align=\"right\" /></a>\n##Learn the Fundamentals of Testing, Specifications and Become a Chimp Ninja!\n[Checkout our new book](http://quality.xolv.io/?utm_source=XolvOSS&utm_medium=OSSDocs&utm_content=ChimpRM-Footer&utm_campaign=QFLaunch) where you can learn how to can use Chimp across the Full Stack from JASMINE to React, Node.JS, Mocha, Meteor and more.\n\n\n**[Quality, Faster.](http://quality.xolv.io/?utm_source=XolvOSS&utm_medium=OSSDocs&utm_content=ChimpRM-Footer&utm_campaign=QFLaunch)** By Sam Hatoum, creator of Chimp.","excerpt":"A quick intro to get started with Chimp and Jasmine","slug":"getting-started-jasmine","type":"basic","title":"Getting Started - Jasmine"}

Getting Started - Jasmine

A quick intro to get started with Chimp and Jasmine

Follow the [Installation](doc:installation) instructions here. [block:api-header] { "type": "basic", "title": "1. Develop" } [/block] To start developing using Jasmine, you have to start Chimp with the `--jasmine` flag like this: [block:code] { "codes": [ { "code": "chimp --jasmine --watch", "language": "shell" } ] } [/block] Chimp will watch your features directory for any `.js` files and rerun any `describe`/`it` blocks that contain the string `@watch`. For example: [block:code] { "codes": [ { "code": "describe('Chimp Jasmine', function() {\n describe('Page title', function () {\n it('should be set by the Meteor method @watch', function () {\n browser.url('http://www.google.com');\n expect(browser.getTitle()).toEqual('Google');\n });\n });\n});", "language": "javascript", "name": "features/example_spec.js" } ] } [/block] Make sure that your spec files end with "_spec", "-spec" or "Spec". By default, Chimp starts a Google Chrome browser window. This is where your specs will run and you can use this window to see the automation as it happens. Chimp also ensures the same window will remain open between your specs rerunning so you won't get an annoying window popup. The watch mode is designed to keep you focused on the task at hand. The idea is you work on a scenario through to completion, and then move the `@watch` tag to the next spec you are working on. You can see this mode in action in the [demo video](http://chimpjs.com) [block:api-header] { "type": "basic", "title": "2. Test" } [/block] You've now finished your tasks and are ready to commit your code. If you want to run the build locally you can run all the tests using this command: [block:code] { "codes": [ { "code": "chimp --jasmine", "language": "shell" } ] } [/block] Chimp recognizes that you're not in watch mode and will run all the specs. This same command can also be used on CI servers. [block:api-header] { "type": "basic", "title": "3. Learn more" } [/block] You can find more info on the [Jasmine support](doc:jasmine-support) page. --- <a href="http://quality.xolv.io/?utm_source=XolvOSS&utm_medium=OSSDocs&utm_content=ChimpRM-Footer&utm_campaign=QFLaunch"><img src="https://files.readme.io/764e495-qualityfasterbook-commas.small.png" width="200" align="right" /></a> ##Learn the Fundamentals of Testing, Specifications and Become a Chimp Ninja! [Checkout our new book](http://quality.xolv.io/?utm_source=XolvOSS&utm_medium=OSSDocs&utm_content=ChimpRM-Footer&utm_campaign=QFLaunch) where you can learn how to can use Chimp across the Full Stack from JASMINE to React, Node.JS, Mocha, Meteor and more. **[Quality, Faster.](http://quality.xolv.io/?utm_source=XolvOSS&utm_medium=OSSDocs&utm_content=ChimpRM-Footer&utm_campaign=QFLaunch)** By Sam Hatoum, creator of Chimp.