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

Add basic help tests as examples #112

Merged
merged 2 commits into from Apr 17, 2018
Merged

Add basic help tests as examples #112

merged 2 commits into from Apr 17, 2018

Conversation

campionfellin
Copy link
Collaborator

Adds necessary testing libraries to the dev dependencies.
Adds npm test and npm coverage scripts to package.json
Edits npm build script to not remove index.js
Edits npm build script to remove the sudo part, as sudo is now required in the .travis.yml file.

Creates 2 tests that check the help command for clasp run --help and clasp logs --help. These give ~10% code coverage and are meant as examples for further tests.

See this build for testing output:

https://travis-ci.org/campionfellin/clasp/builds/367490854

Signed-off-by: campionfellin campionfellin@gmail.com

Signed-off-by: campionfellin <campionfellin@gmail.com>
Signed-off-by: campionfellin <campionfellin@gmail.com>
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.

LGTM.

const spawnSync = require('child_process').spawnSync;

describe('Test help for each function', () => {

Copy link
Contributor

Choose a reason for hiding this comment

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

Next time remove all these newlines.
(We should have a linter fail for these extra newlines everywhere).

);

expect(result.status).to.equal(0);
expect(result.stdout).to.include('Shows the StackDriver Logs');
Copy link
Contributor

Choose a reason for hiding this comment

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

StackDriver logs


describe('Test help for each function', () => {

it('should output help for run command', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

2 spaces everywhere.
(this should be checked by a lint rule next time)

@grant grant merged commit ef47d28 into google:master Apr 17, 2018
@grant
Copy link
Contributor

grant commented Apr 17, 2018

We should name the directory tests too.

@campionfellin campionfellin deleted the help-tests branch April 17, 2018 23:53
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.

None yet

3 participants