apify-test-tools 0.10.2-beta.6 → 0.10.2-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify-test-tools",
3
- "version": "0.10.2-beta.6",
3
+ "version": "0.10.2-beta.7",
4
4
  "type": "module",
5
5
  "description": "TBD",
6
6
  "repository": {
@@ -174,6 +174,14 @@ describe('get-affected-actors CLI on real git histories', () => {
174
174
  });
175
175
  });
176
176
 
177
+ it('counts a moved file for both the Actor it left and the one it joined', async () => {
178
+ git('mv', 'actors/a/main.ts', 'actors/c/moved.ts');
179
+ git('commit', '-q', '-m', 'refactor: move a file from a to c');
180
+
181
+ // With rename detection, git would list only the new path, and A would look unchanged
182
+ expect(getAffectedActors('--base', 'main')).toStrictEqual({ functional: ['a', 'c'], cosmetic: [] });
183
+ });
184
+
177
185
  it('checks the whole branch on a rerun or when --since is not in the history', async () => {
178
186
  await commit('feat(a): validated change', 'actors/a/main.ts');
179
187
  const head = await commit('docs(a): readme', 'actors/a/README.md');
@@ -124,9 +124,12 @@ describe('getChangedFiles', () => {
124
124
  expect(changedFiles).toStrictEqual(['file1.txt', 'folder/file2.txt']);
125
125
 
126
126
  expect(gitCommandSpy).toHaveBeenCalledTimes(1);
127
- expect(gitCommandSpy).toHaveBeenCalledWith(['diff', '--name-only', `${firstSha}~..${lastSha}`], {
128
- operation: 'get the list of changed files between commits',
129
- });
127
+ expect(gitCommandSpy).toHaveBeenCalledWith(
128
+ ['diff', '--name-only', '--no-renames', `${firstSha}~..${lastSha}`],
129
+ {
130
+ operation: 'get the list of changed files between commits',
131
+ },
132
+ );
130
133
  });
131
134
 
132
135
  it('should throw without running git when the commit list is empty', async () => {
@@ -147,7 +150,7 @@ describe('getChangedFiles', () => {
147
150
  expect(changedFiles).toStrictEqual(['file1.txt', 'folder/file2.txt']);
148
151
 
149
152
  expect(gitCommandSpy).toHaveBeenCalledTimes(1);
150
- expect(gitCommandSpy).toHaveBeenCalledWith(['diff', '--name-only', `${onlySha}~..${onlySha}`], {
153
+ expect(gitCommandSpy).toHaveBeenCalledWith(['diff', '--name-only', '--no-renames', `${onlySha}~..${onlySha}`], {
151
154
  operation: 'get the list of changed files between commits',
152
155
  });
153
156
  });
@@ -412,7 +415,7 @@ describe('getChangedFilesBetween', () => {
412
415
  'src/main.ts',
413
416
  'CHANGELOG.md',
414
417
  ]);
415
- expect(spy).toHaveBeenCalledWith(['diff', '--name-only', 'base-sha..head-sha'], {
418
+ expect(spy).toHaveBeenCalledWith(['diff', '--name-only', '--no-renames', 'base-sha..head-sha'], {
416
419
  operation: 'get the list of changed files between commits',
417
420
  });
418
421
  });