Skip to content

Commit b5d751c

Browse files
committed
git tests for sinceCommit = HEAD^^
1 parent 1cd45fd commit b5d751c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

integration_tests/__tests__/jest_changed_files.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,19 @@ test('gets changed files for git', async () => {
191191
.map(filePath => path.basename(filePath))
192192
.sort(),
193193
).toEqual(['file1.txt', 'file4.txt']);
194+
195+
run(`${GIT} add file4.txt`, DIR);
196+
run(`${GIT} commit -m "test3"`, DIR);
197+
198+
({changedFiles: files} = await getChangedFilesForRoots(roots, {
199+
sinceCommit: 'HEAD^^',
200+
}));
201+
// Returns files from the last 2 commits
202+
expect(
203+
Array.from(files)
204+
.map(filePath => path.basename(filePath))
205+
.sort(),
206+
).toEqual(['file1.txt', 'file4.txt']);
194207
});
195208

196209
test('gets changed files for hg', async () => {

0 commit comments

Comments
 (0)