all files / src/commitizen/ commit.js

100% Statements 4/4
100% Branches 0/0
100% Functions 3/3
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                               
import dedent from 'dedent';
import {commit as gitCommit, log} from '../git';
 
export default commit;
 
 /**
  * Asynchronously commits files using commitizen
  */
function commit(sh, inquirer, repoPath, prompter, options, done) {
  
  // Get user input -- side effect that is hard to test
  prompter(inquirer, function(template, overrideOptions) {
    
    // Commit the user input -- side effect that we'll test
    gitCommit(sh, repoPath, template, { ...options, ...overrideOptions }, function() {
      done(template);
    });
  });
   
}