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

Creates tests for clasp clone and clasp pull #119

Merged
merged 4 commits into from
Apr 20, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 27 additions & 2 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@ describe.skip('Test clasp create function', () => {
});
});

// When running this test, please put in a script ID
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean "put in a script ID"?
Can we first create a test script ID, then clone it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, we can do one and hard code it for everyone, if you think that's better. Or use the one from the clasp create test.

// then use `sudo npm run build` before running test.
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need to build before any test?

Shouldn't we have this in the file header comment if that is the case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah good point

describe.skip('Test clasp clone function', () => {
it('should clone an existing project correctly', () => {
spawnSync('rm', ['.clasp.json']);
const result = spawnSync(
'clasp', ['clone', '[SCRIPT_ID]'], { encoding: 'utf8' }
);
expect(result.stdout).to.contain('Cloned');
expect(result.stdout).to.contain('files.');
expect(result.status).to.equal(0);
});
});

describe.skip('Test clasp pull function', () => {
it('should pull an existing project correctly', () => {
const result = spawnSync(
'clasp', ['pull'], { encoding: 'utf8' }
);
expect(result.stdout).to.contain('Cloned');
expect(result.stdout).to.contain('files.');
expect(result.status).to.equal(0);
});
});

/**
* TODO: Test these commands and configs.
*
Expand All @@ -54,8 +79,8 @@ describe.skip('Test clasp create function', () => {
* [ ] clasp create "myTitle"
* [x] clasp create <untitled>
* [x] clasp list
* [ ] clasp clone <scriptId>
* [ ] clasp pull
* [x] clasp clone <scriptId>
* [x] clasp pull
* [ ] echo '// test' >> index.js && clasp push
* [ ] clasp open
* [ ] clasp deployments
Expand Down