{"action":"created","issue":{"url":"https://api.github.com/repos/exercism/exercism.io/issues/1976","labels_url":"https://api.github.com/repos/exercism/exercism.io/issues/1976/labels{/name}","comments_url":"https://api.github.com/repos/exercism/exercism.io/issues/1976/comments","events_url":"https://api.github.com/repos/exercism/exercism.io/issues/1976/events","html_url":"https://github.com/exercism/exercism.io/issues/1976","id":46198780,"number":1976,"title":"Proposal: Install jasmine-node Locally","user":{"login":"Havvy","id":731722,"avatar_url":"https://avatars.githubusercontent.com/u/731722?v=3","gravatar_id":"","url":"https://api.github.com/users/Havvy","html_url":"https://github.com/Havvy","followers_url":"https://api.github.com/users/Havvy/followers","following_url":"https://api.github.com/users/Havvy/following{/other_user}","gists_url":"https://api.github.com/users/Havvy/gists{/gist_id}","starred_url":"https://api.github.com/users/Havvy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Havvy/subscriptions","organizations_url":"https://api.github.com/users/Havvy/orgs","repos_url":"https://api.github.com/users/Havvy/repos","events_url":"https://api.github.com/users/Havvy/events{/privacy}","received_events_url":"https://api.github.com/users/Havvy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-10-19T07:05:55Z","updated_at":"2015-01-20T14:37:42Z","closed_at":null,"body":"Currently, testing JavaScript involves globally installing the jasmine-node executable. This is bad, because globally installing usually requires root, and if other projects need an incompatible version of jasmine-node, you can't use this. It also requires adding another step before getting to the exercises, which \r\n\r\nSo, instead of requesting that we install yet another program globally, why not install the package locally to `%exercism%/javascript/jasmine` and then in each problem, add a package.json that has has the following scripts property:\r\n\r\n````javascript\r\n\"scripts\": {\r\n    \"test\": \"../jasmine/bin/jasmine test.js\"\r\n}\r\n````\r\n\r\nYou could also set the author of the test and some other metadata if you'd like.\r\n\r\nYou should also set `\"private\": true` to make sure people don't publish their solutions to npmjs.org.\r\n\r\nThen, to actually test the code, the user would just have to do `npm test` in the test directory, and wouldn't need to install jasmine-node globally.\r\n\r\n\r\nIf you're fetch system doesn't handle fetching tooling directories, you could also put jasmine-node in the node_modules directory, and change the script to \"jasmine test.js\". Make sure you install jasmine normally though, since the executable gets a symlink put into `/node_modules/.bin/` which is added to the path for any npm scripts. The drawback here though, is downloading jasmine for every test...\r\n\r\nIf you accept this proposal, and tell me which way you are going to install jasmine-node, I can pass you a PR that adds the package.json files to each test."},"comment":{"url":"https://api.github.com/repos/exercism/exercism.io/issues/comments/70662483","html_url":"https://github.com/exercism/exercism.io/issues/1976#issuecomment-70662483","issue_url":"https://api.github.com/repos/exercism/exercism.io/issues/1976","id":70662483,"user":{"login":"Havvy","id":731722,"avatar_url":"https://avatars.githubusercontent.com/u/731722?v=3","gravatar_id":"","url":"https://api.github.com/users/Havvy","html_url":"https://github.com/Havvy","followers_url":"https://api.github.com/users/Havvy/followers","following_url":"https://api.github.com/users/Havvy/following{/other_user}","gists_url":"https://api.github.com/users/Havvy/gists{/gist_id}","starred_url":"https://api.github.com/users/Havvy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Havvy/subscriptions","organizations_url":"https://api.github.com/users/Havvy/orgs","repos_url":"https://api.github.com/users/Havvy/repos","events_url":"https://api.github.com/users/Havvy/events{/privacy}","received_events_url":"https://api.github.com/users/Havvy/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T14:37:42Z","updated_at":"2015-01-20T14:37:42Z","body":"They'd be more likely to `sudo npm install -g jasmine-node`. Node.js and npm come bundled together in most (all?) distributions, so they wouldn't need to learn how to use `npm install` AND `jasmine test.js` nor be installing global stuff outside their package manager. They'd just need to do `npm test` which is easier to teach than the installation + new global command thing that currently happens."}}