message: add git tests
diff: */
  import {assert} from 'chai';
  -import {mkdirSync} from 'fs';
  -import {promisify} from 'util';
  +import fs = require('fs');
  +import util = require('util');
  import path = require('path');
  import _rimraf = require('rimraf');
  import {GitRepo} from '../git';
  import exec from '../util/exec';
  -const rimraf: (dir: string) => void = promisify(_rimraf);
  -
  +const rimraf: (dir: string) => void = util.promisify(_rimraf);
  suite('src/git', function() {
  @@ -36,10 +35,12 @@ suite('src/git', function() {
  path.join(__dirname, 'POLYMER_WORKSPACES_DOES_NOT_EXIST_DIR');
  setup(async () => {
  - mkdirSync(gitDir);
  - mkdirSync(emptyDir);
  + fs.mkdirSync(gitDir);
  + fs.mkdirSync(emptyDir);
  const gitInitResult = await exec(gitDir, `git`, [`init`]);
  assert.equal(gitInitResult.stderr, '');
  + const gitCommitResult = await exec(gitDir, `git`, [`commit`, `--allow-empty`, `-m`, `"testing"`]);
  + assert.equal(gitCommitResult.stderr, '');
  });
  teardown(async () => {
  @@ -69,9 +70,6 @@ suite('src/git', function() {
  suite('gitRepo.getHeadSha()', () => {
  test('returns the head SHA for a given git repo', async () => {
  - // Empty repos have no HEAD commit. Create one so that this makes sense.
  - await exec(
  - gitDir, 'git', ['commit', '-m', '"test commit"', '--allow-empty']);
  const gitRepo = new GitRepo(gitDir);
  const gitHeadSha = await gitRepo.getHeadSha();
  assert.isString(gitHeadSha);
  @@ -80,5 +78,35 @@ suite('src/git', function() {
  });
  + suite('gitRepo.createBranch()', async() => {
  +
  + test('creates a new branch in the git repo', async () => {
  + const gitRepo = new GitRepo(gitDir);
  + await gitRepo.createBranch('abcdefgh');
  + const getBranchNameResult = await exec(
  + gitDir, 'git', ['status']);
  + assert.include(getBranchNameResult.stdout, 'On branch abcdefgh');
  + });
  +
  + });
  +
  + suite('gitRepo.checkout()', async() => {
  +
  + test('creates a new branch in the git repo', async () => {
  + const gitRepo = new GitRepo(gitDir);
  + await exec(gitDir, 'git', ['checkout', '-b', 'branch-1']);
  + await exec(gitDir, 'git', ['checkout', '-b', 'branch-2']);
  + const getBranch2NameResult = await exec(
  + gitDir, 'git', ['status']);
  + assert.include(getBranch2NameResult.stdout, 'On branch branch-2');
  + await gitRepo.checkout('branch-1');
  + const getBranch1NameResult = await exec(
  + gitDir, 'git', ['status']);
  + assert.include(getBranch1NameResult.stdout, 'On branch branch-1');
  + });
  +
  + });
  +
  +
  });
  });
  \ No newline at end of file
  