MCPcopy Create free account
hub / github.com/toplenboren/simple-git-hooks / tryToPerformTestCommit

Function tryToPerformTestCommit

simple-git-hooks.test.js:843–853  ·  view source on GitHub ↗
(path, env = process.env)

Source from the content-addressed store, hash-verified

841 };
842
843 const tryToPerformTestCommit = (path, env = process.env) => {
844 try {
845 execSync(
846 'git add . && git commit --allow-empty -m "Test commit" && git commit --allow-empty -am "Change commit msg"',
847 { cwd: path, env: env, }
848 );
849 return true;
850 } catch (e) {
851 return false;
852 }
853 };
854
855 const expectCommitToSucceed = (path) => {
856 expect(tryToPerformTestCommit(path)).toBe(true);

Callers 2

expectCommitToSucceedFunction · 0.85
expectCommitToFailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected