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

Modify tests to avoid spawnSync behavior on Windows #232

Merged
merged 1 commit into from
Jun 25, 2018

Conversation

wilt00
Copy link
Contributor

@wilt00 wilt00 commented Jun 23, 2018

Fixes #231

  • npm run test succeeds. (!)
  • npm run lint succeeds.
  • Appropriate changes to README are included in PR. (N/A)

@coveralls
Copy link

coveralls commented Jun 23, 2018

Coverage Status

Coverage increased (+0.09%) to 15.76% when pulling 01a2521 on wilt00:winTests into 4a0c511 on google:master.

@@ -9,18 +9,19 @@ import { getAPIFileType, getScriptURL, saveProjectId } from './../src/utils.js';
const { spawnSync } = require('child_process');
const TEST_CODE_JS = 'function test() { Logger.log(\'test\'); }';
const TEST_JSON = '{"timeZone": "America/New_York"}';
const CLASP = (os.type() === 'Windows_NT') ? 'clasp.cmd' : 'clasp';
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment would be nice here.
But this is pretty self-explanatory too.

Copy link
Contributor

@grant grant left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!
Let me know if master passes on your Windows machine (I don't have a Windows machine).

@grant grant merged commit 304978f into google:master Jun 25, 2018
@wilt00
Copy link
Contributor Author

wilt00 commented Jun 26, 2018

Yep, the tests pass! The only bit of weirdness left is that npm run build doesn't work because the semicolon gets ignored and both commands get combined together. I was able to build by running npx tsc --project tsconfig.json and npm i -g --loglevel=error as separate commands, then running npm run test. Double ampersand seems to work fine.

Complete error message in case someone needs to search for it:

error TS5023: Unknown compiler option '-g'.
error TS5023: Unknown compiler option '--loglevel=error;'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @google/clasp@1.4.0 build: `tsc --project tsconfig.json; npm i -g --loglevel=error;`
npm ERR! Exit status 1

@grant
Copy link
Contributor

grant commented Jun 26, 2018

If && fixes it (instead of ;), let's change it. PRs are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants