{"action":"created","issue":{"url":"https://api.github.com/repos/thlorenz/proxyquire/issues/72","labels_url":"https://api.github.com/repos/thlorenz/proxyquire/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/thlorenz/proxyquire/issues/72/comments","events_url":"https://api.github.com/repos/thlorenz/proxyquire/issues/72/events","html_url":"https://github.com/thlorenz/proxyquire/issues/72","id":99452460,"number":72,"title":"Paths passed to proxyquire must be relative to the file that actually required proxyquire, not to the currently executing test","user":{"login":"epchris","id":120530,"avatar_url":"https://avatars.githubusercontent.com/u/120530?v=3","gravatar_id":"","url":"https://api.github.com/users/epchris","html_url":"https://github.com/epchris","followers_url":"https://api.github.com/users/epchris/followers","following_url":"https://api.github.com/users/epchris/following{/other_user}","gists_url":"https://api.github.com/users/epchris/gists{/gist_id}","starred_url":"https://api.github.com/users/epchris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epchris/subscriptions","organizations_url":"https://api.github.com/users/epchris/orgs","repos_url":"https://api.github.com/users/epchris/repos","events_url":"https://api.github.com/users/epchris/events{/privacy}","received_events_url":"https://api.github.com/users/epchris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-06T14:41:33Z","updated_at":"2015-08-06T14:50:36Z","closed_at":"2015-08-06T14:50:36Z","body":"In a lot of our tests we want to centralize test bootstrapping so we've put loading of proxyquire into a centralized bootstrap file.  So in a given test file this ends up looking like this (coffeescript):\r\n\r\n`{proxyquire} = require '../helpers/bootstrap'`\r\n\r\nWhen doing this , all of my calls to `proxyquire(...)` need to have the path relative to the bootstrap.coffee file and not the test file.\r\n\r\nTo test this, I removed the requiring of proxyquire from the bootstrap file into the test file itself and paths worked as expected.  I also moved the bootstrap file to a new directory and confirmed that I had to change all of my relative paths passed to the proxyquire call to be relative to the new bootstrap.\r\n\r\nAny ideas as to why this might be happening or if there's a possible fix?"},"comment":{"url":"https://api.github.com/repos/thlorenz/proxyquire/issues/comments/128401319","html_url":"https://github.com/thlorenz/proxyquire/issues/72#issuecomment-128401319","issue_url":"https://api.github.com/repos/thlorenz/proxyquire/issues/72","id":128401319,"user":{"login":"bendrucker","id":808808,"avatar_url":"https://avatars.githubusercontent.com/u/808808?v=3","gravatar_id":"","url":"https://api.github.com/users/bendrucker","html_url":"https://github.com/bendrucker","followers_url":"https://api.github.com/users/bendrucker/followers","following_url":"https://api.github.com/users/bendrucker/following{/other_user}","gists_url":"https://api.github.com/users/bendrucker/gists{/gist_id}","starred_url":"https://api.github.com/users/bendrucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendrucker/subscriptions","organizations_url":"https://api.github.com/users/bendrucker/orgs","repos_url":"https://api.github.com/users/bendrucker/repos","events_url":"https://api.github.com/users/bendrucker/events{/privacy}","received_events_url":"https://api.github.com/users/bendrucker/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T14:50:36Z","updated_at":"2015-08-06T14:50:36Z","body":"Nope, this is just the way requires work. They're always relative to the file in which they run."}}