Skip to content

Commit 84791bf

Browse files
author
Robert Jackson
committed
Ensure to use real path for file.path expectation.
Apparently, jscodeshift runs the provided path through `fs.realpathSync` but the return value from `broccoli-test-helper` hasn't passed through `realpathSync`. On most linux / windows systems this doesn't matter, but on mac the `$TMPDIR` is references as `/var/folders/random-stuff/here/` but "really" is at `/private/var/folders/random-stuff/here/`.
1 parent 4ccaf8b commit 84791bf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/cli-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ QUnit.module('codemod-cli', function(hooks) {
189189
QUnit.test(
190190
'transform should receive a file path in tests',
191191
wrap(function*(assert) {
192-
const expectedPath = `${codemodProject.path()}/transforms/main/__testfixtures__/basic.input.js`;
192+
const realCodemodProjectPath = fs.realpathSync(codemodProject.path());
193+
const expectedPath = `${realCodemodProjectPath}/transforms/main/__testfixtures__/basic.input.js`;
193194

194195
yield execa(EXECUTABLE_PATH, ['generate', 'codemod', 'main']);
195196

0 commit comments

Comments
 (0)