{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/684","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/684/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/684/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/684/events","html_url":"https://github.com/systemjs/systemjs/issues/684","id":100184056,"number":684,"title":"Can't override System.config paths","user":{"login":"topheman","id":985982,"avatar_url":"https://avatars.githubusercontent.com/u/985982?v=3","gravatar_id":"","url":"https://api.github.com/users/topheman","html_url":"https://github.com/topheman","followers_url":"https://api.github.com/users/topheman/followers","following_url":"https://api.github.com/users/topheman/following{/other_user}","gists_url":"https://api.github.com/users/topheman/gists{/gist_id}","starred_url":"https://api.github.com/users/topheman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/topheman/subscriptions","organizations_url":"https://api.github.com/users/topheman/orgs","repos_url":"https://api.github.com/users/topheman/repos","events_url":"https://api.github.com/users/topheman/events{/privacy}","received_events_url":"https://api.github.com/users/topheman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-10T22:37:29Z","updated_at":"2015-08-11T13:29:04Z","closed_at":null,"body":"Hie,\r\n\r\nI'm trying to override System.config paths in order to inject stubs for unit tests.\r\n\r\nI first tried adding a second block specifying my modules on which my unit tests are based like that:\r\n\r\n```html\r\n<script src=\"jspm_packages/system.js\"></script>\r\n<script src=\"jspm.config.js\"></script>\r\n<!-- config to override geolocation service with proper stub -->\r\n<script>\r\nSystem.config({\r\n  \"paths\":{\r\n    \"app/services/geolocation/geolocation.js\":\"test/unit/stubs/services/geolocation/geolocation.js\"\r\n  }\r\n});\r\n</script>\r\n````\r\n\r\nThen, I tried to inject it directly in `jspm.config.js` file. The paths part would look like that:\r\n\r\n```json\r\n\"paths\": {\r\n  \"app/services/geolocation/geolocation.js\": \"test/unit/stubs/services/geolocation/geolocation.js\",\r\n  \"github:*\": \"jspm_packages/github/*\",\r\n  \"npm:*\": \"jspm_packages/npm/*\"\r\n}\r\n````\r\n\r\nI tried everything: declaring after, before, changing the paths ...\r\n\r\nI can see ithe path I declared in the console when I access to `System.paths` but it doesn't have any effects.\r\n\r\nAm I doing something wrong ? Is this not the way to override module for such a use case ?\r\n\r\nTophe\r\n\r\nNote:\r\n\r\nIn my `jspm.config.js`, I have `baseUrl = './'`\r\n\r\nI require my module that way : `import geoip from '../../services/geolocation/geolocation.js';`\r\n\r\nI also tried to import it that way : `import geoip from '/app/services/geolocation/geolocation.js';` it didn't change anything, it was still the original, not the stub.\r\n\r\nMade with jspm `0.16.0-beta.3`"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/129873405","html_url":"https://github.com/systemjs/systemjs/issues/684#issuecomment-129873405","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/684","id":129873405,"user":{"login":"topheman","id":985982,"avatar_url":"https://avatars.githubusercontent.com/u/985982?v=3","gravatar_id":"","url":"https://api.github.com/users/topheman","html_url":"https://github.com/topheman","followers_url":"https://api.github.com/users/topheman/followers","following_url":"https://api.github.com/users/topheman/following{/other_user}","gists_url":"https://api.github.com/users/topheman/gists{/gist_id}","starred_url":"https://api.github.com/users/topheman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/topheman/subscriptions","organizations_url":"https://api.github.com/users/topheman/orgs","repos_url":"https://api.github.com/users/topheman/repos","events_url":"https://api.github.com/users/topheman/events{/privacy}","received_events_url":"https://api.github.com/users/topheman/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T13:29:04Z","updated_at":"2015-08-11T13:29:04Z","body":"@guybedford It does contain the correct path.\r\n\r\nI pushed my code in a branch on https://github.com/topheman/vanilla-es6-jspm/tree/feature/override-systemjs-paths\r\n\r\n```shell\r\n$ git clone https://github.com/topheman/vanilla-es6-jspm.git\r\n$ cd vanilla-es6-jspm\r\n$ git checkout feature/override-systemjs-paths\r\n$ npm install\r\n$ gulp serve:test\r\n```\r\n\r\nI'm injecting the override of System.paths via browserSync, you'll see confirmation via a console log, before all the calls to the assets (if you view source the page, you can see the `System.config()` call).\r\n\r\nStill, when you click on the red button, it's making an xhr (the `app/services/geolocation/geolocation.js` file is still loaded, not the one specified in the config override, which sould be : `test/unit/stubs/services/geolocation/geolocation.js`)"}}