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 all commits
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
28 changes: 26 additions & 2 deletions tests/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, it } from 'mocha';
import { expect } from 'chai';
import * as fs from 'fs';
const { spawnSync } = require('child_process');

describe('Test help for each function', () => {
Expand Down Expand Up @@ -43,6 +44,29 @@ describe.skip('Test clasp create function', () => {
});
});

describe.skip('Test clasp clone function', () => {
it('should clone an existing project correctly', () => {
const settings = JSON.parse(fs.readFileSync('.clasp.json', 'utf8'));
const result = spawnSync(
'clasp', ['clone', settings.scriptId], { 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 +78,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