Added git reset to test
This commit is contained in:
parent
d9b7476a9e
commit
31d73dbcc7
|
@ -6,7 +6,7 @@ import {
|
|||
removeRepo,
|
||||
} from "../gitClient";
|
||||
import { existsSync, readdirSync } from "fs";
|
||||
import { execSync } from "child_process";
|
||||
import { exec, execSync } from "child_process";
|
||||
|
||||
test("successfully clones repo", async () => {
|
||||
const folderPath = await cloneRepo("https://github.com/octocat/Spoon-Knife");
|
||||
|
@ -23,6 +23,7 @@ test("successfully commits to repo", async () => {
|
|||
try {
|
||||
execSync(`cd ${folderPath} && touch newFile.ts`);
|
||||
await commitRepo(folderPath);
|
||||
execSync("git reset --hard"); // hard reset to delete any uncommitted files
|
||||
const directoryContents = readdirSync(folderPath);
|
||||
expect(directoryContents).toContain("newFile.ts");
|
||||
} catch (error) {
|
||||
|
|
Loading…
Reference in New Issue