Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: explicitly run cli with node to fix tests on windows #53

Merged
merged 1 commit into from
Jun 8, 2016

Conversation

Tapppi
Copy link
Member

@Tapppi Tapppi commented Jun 8, 2016

Explicitly run the cli with 'node <index.js path>' to fix running tests on windows.
There seems to be a bug overwriting project package.json and CHANGELOG.md
on windows after failed tests.

Fixes #50

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 725ba1f on Tapppi:50-fix-win-tests into * on conventional-changelog:master*.

@@ -14,6 +14,10 @@ function commit (msg) {
shell.exec('git commit --allow-empty -m"' + msg + '"')
}

function execCli (argString) {
return shell.exec('node ' + cliPath + ' ' + argString)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should change this to:

return shell.exec('node ' + cliPath + (argString ? ' ' + argString : ''))

To avoid command strings like node /Users/nexdrew/git/qi/standard-version/index.js undefined

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! To allow falsy values without allowing undefined or null I changed it to:

return shell.exec('node ' + cliPath + (argString != null ? ' ' + argString : ''))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually not necessary :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Steve said, I don't think we need to worry about allowing falsy values here, but this should be fine.

@Tapppi Tapppi force-pushed the 50-fix-win-tests branch from 725ba1f to e76be53 Compare June 8, 2016 11:48
@coveralls
Copy link

coveralls commented Jun 8, 2016

Coverage Status

Coverage remained the same at 95.294% when pulling e76be53 on Tapppi:50-fix-win-tests into 5e56185 on conventional-changelog:master.

@Tapppi
Copy link
Member Author

Tapppi commented Jun 8, 2016

New git add test added in #55 will break this again, so probably should hold off on this and rebase after that's merged?

@nexdrew
Copy link
Member

nexdrew commented Jun 8, 2016

@Tapppi Rebasing this once #55 is merged makes sense to me - good call.

@Tapppi Tapppi force-pushed the 50-fix-win-tests branch from e76be53 to 2266ecd Compare June 8, 2016 17:29
Explicitly run the cli with 'node <index.js path>' to fix running tests on windows.

Fixes conventional-changelog#50
@Tapppi Tapppi force-pushed the 50-fix-win-tests branch from 2266ecd to afef731 Compare June 8, 2016 17:32
@coveralls
Copy link

coveralls commented Jun 8, 2016

Coverage Status

Coverage remained the same at 95.402% when pulling afef731 on Tapppi:50-fix-win-tests into f361c46 on conventional-changelog:master.

@coveralls
Copy link

coveralls commented Jun 8, 2016

Coverage Status

Coverage remained the same at 95.402% when pulling 2266ecd on Tapppi:50-fix-win-tests into f361c46 on conventional-changelog:master.

@Tapppi
Copy link
Member Author

Tapppi commented Jun 8, 2016

Rebased after #55 was merged, new test updated to use execCli as well. Should be fine for a merge.

@nexdrew nexdrew merged commit e160445 into conventional-changelog:master Jun 8, 2016
@nexdrew
Copy link
Member

nexdrew commented Jun 8, 2016

Awesome, thanks!

@Tapppi Tapppi deleted the 50-fix-win-tests branch June 8, 2016 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Tests fail on windows with JScript compilation errors
4 participants