{"action":"created","issue":{"url":"https://api.github.com/repos/shelljs/shelljs/issues/296","labels_url":"https://api.github.com/repos/shelljs/shelljs/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/shelljs/shelljs/issues/296/comments","events_url":"https://api.github.com/repos/shelljs/shelljs/issues/296/events","html_url":"https://github.com/shelljs/shelljs/issues/296","id":127427608,"number":296,"title":"Failing tests on Windows","user":{"login":"BYK","id":126780,"avatar_url":"https://avatars.githubusercontent.com/u/126780?v=3","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-19T11:45:15Z","updated_at":"2016-01-21T00:41:05Z","closed_at":null,"body":"There are failing tests on Windows. My system is Node 4.2.4 with Windows 10:\r\n\r\n```\r\nBYK@ ~▶Documents▶Projects▶shelljs⛕ master$ npm test\r\n\r\n> shelljs@0.5.3 test C:\\Users\\BYK\\Documents\\Projects\\shelljs\r\n> node scripts/run-tests\r\n\r\n'.' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n*** JSHINT FAILED! (return code != 0)\r\n\r\nRunning test: cat.js\r\nRunning test: cd.js\r\nRunning test: chmod.js\r\n\r\nassert.js:89\r\n  throw new assert.AssertionError({\r\n  ^\r\nAssertionError: 438 == 493\r\n    at Object.<anonymous> (C:\\Users\\BYK\\Documents\\Projects\\shelljs\\test\\chmod.js:23:8)\r\n    at Module._compile (module.js:435:26)\r\n    at Object.Module._extensions..js (module.js:442:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:313:12)\r\n    at Function.Module.runMain (module.js:467:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:963:3\r\n*** TEST FAILED! (missing exit code \"123\")\r\n\r\nRunning test: common.js\r\nRunning test: config.js\r\nRunning test: cp.js\r\n\r\nassert.js:89\r\n  throw new assert.AssertionError({\r\n  ^\r\nAssertionError: 0 == 1\r\n    at Object.<anonymous> (C:\\Users\\BYK\\Documents\\Projects\\shelljs\\test\\cp.js:145:8)\r\n    at Module._compile (module.js:435:26)\r\n    at Object.Module._extensions..js (module.js:442:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:313:12)\r\n    at Function.Module.runMain (module.js:467:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:963:3\r\n*** TEST FAILED! (missing exit code \"123\")\r\n\r\nRunning test: dirs.js\r\nRunning test: echo.js\r\nRunning test: env.js\r\nRunning test: exec.js\r\nRunning test: find.js\r\nRunning test: grep.js\r\nRunning test: ln.js\r\n\r\nassert.js:89\r\n  throw new assert.AssertionError({\r\n  ^\r\nAssertionError: false == true\r\n    at Object.<anonymous> (C:\\Users\\BYK\\Documents\\Projects\\shelljs\\test\\ln.js:51:1)\r\n    at Module._compile (module.js:435:26)\r\n    at Object.Module._extensions..js (module.js:442:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:313:12)\r\n    at Function.Module.runMain (module.js:467:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:963:3\r\n*** TEST FAILED! (missing exit code \"123\")\r\n\r\nRunning test: ls.js\r\nRunning test: make.js\r\nRunning test: mkdir.js\r\nRunning test: mv.js\r\nRunning test: popd.js\r\nRunning test: pushd.js\r\n\r\nassert.js:89\r\n  throw new assert.AssertionError({\r\n  ^\r\nAssertionError: 'resources\\\\pushd' == 'resources/pushd'\r\n    at Object.<anonymous> (C:\\Users\\BYK\\Documents\\Projects\\shelljs\\test\\pushd.js:193:8)\r\n    at Module._compile (module.js:435:26)\r\n    at Object.Module._extensions..js (module.js:442:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:313:12)\r\n    at Function.Module.runMain (module.js:467:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:963:3\r\n*** TEST FAILED! (missing exit code \"123\")\r\n\r\nRunning test: pwd.js\r\nRunning test: rm.js\r\nRunning test: sed.js\r\nRunning test: tempdir.js\r\nRunning test: test.js\r\n\r\nassert.js:89\r\n  throw new assert.AssertionError({\r\n  ^\r\nAssertionError: false == true\r\n    at Object.<anonymous> (C:\\Users\\BYK\\Documents\\Projects\\shelljs\\test\\test.js:76:8)\r\n    at Module._compile (module.js:435:26)\r\n    at Object.Module._extensions..js (module.js:442:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:313:12)\r\n    at Function.Module.runMain (module.js:467:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:963:3\r\n*** TEST FAILED! (missing exit code \"123\")\r\n\r\nRunning test: to.js\r\nRunning test: toEnd.js\r\nRunning test: touch.js\r\nRunning test: which.js\r\n\r\n*******************************************************\r\nWARNING: Some tests did not pass!\r\n*******************************************************\r\nnpm ERR! Test failed.  See above for more details.\r\n```"},"comment":{"url":"https://api.github.com/repos/shelljs/shelljs/issues/comments/173413870","html_url":"https://github.com/shelljs/shelljs/issues/296#issuecomment-173413870","issue_url":"https://api.github.com/repos/shelljs/shelljs/issues/296","id":173413870,"user":{"login":"nfischer","id":5801521,"avatar_url":"https://avatars.githubusercontent.com/u/5801521?v=3","gravatar_id":"","url":"https://api.github.com/users/nfischer","html_url":"https://github.com/nfischer","followers_url":"https://api.github.com/users/nfischer/followers","following_url":"https://api.github.com/users/nfischer/following{/other_user}","gists_url":"https://api.github.com/users/nfischer/gists{/gist_id}","starred_url":"https://api.github.com/users/nfischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfischer/subscriptions","organizations_url":"https://api.github.com/users/nfischer/orgs","repos_url":"https://api.github.com/users/nfischer/repos","events_url":"https://api.github.com/users/nfischer/events{/privacy}","received_events_url":"https://api.github.com/users/nfischer/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T00:41:05Z","updated_at":"2016-01-21T00:41:05Z","body":"@BYK The issue with `exec()` is related to #250. When running a shelljs script from `cmd.exe`, I've seen that any `exec()` calls will run in the home directory.\r\n\r\n```Javascript\r\nrequire('shelljs/global');\r\necho(pwd()); // This is ShellJS's pwd command, which **will be** correct on Windows\r\nexec('cd'); // Windows 'cd' is the equivalent of Unix's pwd command\r\n```\r\n\r\nI'm observing that, given I'm in a directory **other than** my home directory, then this will not output the same string twice (as I would expect it to).\r\n\r\nI'm running this on Windows 7 64bit, using `cmd.exe` as my shell. If you see different behavior, with or without a different configuration, let me know."}}