Skip to content
Prev Previous commit
Next Next commit
chore(INFRA-3081): update
  • Loading branch information
jluque0101 committed Nov 4, 2025
commit 01d16bb10d034a96013a8621c0aef6820b49d3f9
1 change: 1 addition & 0 deletions src/get-new-changes.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as runCommandModule from './run-command';
import { getNewChangeEntries } from './get-new-changes';

Check failure on line 2 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

`./get-new-changes` import should occur before import of `./run-command`

Check failure on line 2 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

`./get-new-changes` import should occur before import of `./run-command`

Check failure on line 2 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

`./get-new-changes` import should occur before import of `./run-command`

// Mock the run-command module
jest.mock('./run-command');
Expand All @@ -7,9 +7,9 @@
const mockRunCommand = runCommandModule.runCommand as jest.MockedFunction<
typeof runCommandModule.runCommand
>;
const mockRunCommandAndSplit = runCommandModule.runCommandAndSplit as jest.MockedFunction<

Check failure on line 10 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Insert `⏎·`

Check failure on line 10 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Insert `⏎·`

Check failure on line 10 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Insert `⏎·`
typeof runCommandModule.runCommandAndSplit

Check failure on line 11 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Insert `··`

Check failure on line 11 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Insert `··`

Check failure on line 11 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Insert `··`
>;

Check failure on line 12 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Insert `··`

Check failure on line 12 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Insert `··`

Check failure on line 12 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Insert `··`

const repoUrl = 'https://github.com/MetaMask/metamask-mobile';

Expand All @@ -23,7 +23,7 @@
describe('filtering commits without PR numbers', () => {
it('should exclude commits without PR numbers', async () => {
// Mock git rev-list to return commit hashes
mockRunCommandAndSplit.mockResolvedValueOnce(['commit1', 'commit2', 'commit3']);

Check failure on line 26 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Replace `'commit1',·'commit2',·'commit3'` with `⏎········'commit1',⏎········'commit2',⏎········'commit3',⏎······`

Check failure on line 26 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Replace `'commit1',·'commit2',·'commit3'` with `⏎········'commit1',⏎········'commit2',⏎········'commit3',⏎······`

Check failure on line 26 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Replace `'commit1',·'commit2',·'commit3'` with `⏎········'commit1',⏎········'commit2',⏎········'commit3',⏎······`

// Mock git show calls for each commit
// Commit 1: Has PR number (squash & merge format)
Expand All @@ -44,7 +44,7 @@
expect(result).toHaveLength(2);
expect(result[0].description).toContain('12345');
expect(result[1].description).toContain('12346');
expect(result.find((r) => r.description.includes('Attributions'))).toBeUndefined();

Check failure on line 47 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Identifier name 'r' is too short (< 2)

Check failure on line 47 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Replace `result.find((r)·=>·r.description.includes('Attributions'))` with `⏎········result.find((r)·=>·r.description.includes('Attributions')),⏎······`

Check failure on line 47 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Identifier name 'r' is too short (< 2)

Check failure on line 47 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Replace `result.find((r)·=>·r.description.includes('Attributions'))` with `⏎········result.find((r)·=>·r.description.includes('Attributions')),⏎······`

Check failure on line 47 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Identifier name 'r' is too short (< 2)

Check failure on line 47 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Replace `result.find((r)·=>·r.description.includes('Attributions'))` with `⏎········result.find((r)·=>·r.description.includes('Attributions')),⏎······`
});

it('should exclude direct commits even with meaningful messages', async () => {
Expand All @@ -64,11 +64,11 @@

expect(result).toHaveLength(1);
expect(result[0].description).toContain('important feature');
expect(result.find((r) => r.description.includes('Bump version'))).toBeUndefined();

Check failure on line 67 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Identifier name 'r' is too short (< 2)

Check failure on line 67 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Replace `result.find((r)·=>·r.description.includes('Bump·version'))` with `⏎········result.find((r)·=>·r.description.includes('Bump·version')),⏎······`

Check failure on line 67 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Identifier name 'r' is too short (< 2)

Check failure on line 67 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Replace `result.find((r)·=>·r.description.includes('Bump·version'))` with `⏎········result.find((r)·=>·r.description.includes('Bump·version')),⏎······`

Check failure on line 67 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Identifier name 'r' is too short (< 2)

Check failure on line 67 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Replace `result.find((r)·=>·r.description.includes('Bump·version'))` with `⏎········result.find((r)·=>·r.description.includes('Bump·version')),⏎······`
});

it('should handle merge commit format and exclude direct commits', async () => {
mockRunCommandAndSplit.mockResolvedValueOnce(['commit1', 'commit2', 'commit3']);

Check failure on line 71 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Replace `'commit1',·'commit2',·'commit3'` with `⏎········'commit1',⏎········'commit2',⏎········'commit3',⏎······`

Check failure on line 71 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Replace `'commit1',·'commit2',·'commit3'` with `⏎········'commit1',⏎········'commit2',⏎········'commit3',⏎······`

Check failure on line 71 in src/get-new-changes.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (22.x)

Replace `'commit1',·'commit2',·'commit3'` with `⏎········'commit1',⏎········'commit2',⏎········'commit3',⏎······`

mockRunCommand
.mockResolvedValueOnce('feat: feature (#12345)') // Squash merge
Expand Down Expand Up @@ -529,3 +529,4 @@
});



Loading