mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
chore(deps): upgrade jest to v30
Bump jest ^29.5.0 -> ^30.4.2, @types/jest ^29.5.14 -> ^30.0.0, and ts-jest ^29.4.6 -> ^29.4.11. @types/jest@30 removes the deprecated `toThrowError` matcher type, so migrate every `.toThrowError()` assertion to `.toThrow()`.
This commit is contained in:
@@ -6,11 +6,11 @@ describe('validateKind', () => {
|
||||
});
|
||||
|
||||
it('throws a helpful exception if its an invalid kind', () => {
|
||||
expect(() => validateKind(<any>"taco")).toThrowError();
|
||||
expect(() => validateKind(<any>"taco")).toThrow();
|
||||
})
|
||||
|
||||
it('throws a helpful exception if custom versions are provided with the wrong kind', () => {
|
||||
expect(() => validateKind(<any>"latest", [])).toThrowError();
|
||||
expect(() => validateKind(<any>"latest", [])).toThrow();
|
||||
})
|
||||
|
||||
it('returns `true` for kind `custom` with a custom versions', () => {
|
||||
|
||||
@@ -62,7 +62,7 @@ describe('getMatrixForKind for mage-os', () => {
|
||||
});
|
||||
|
||||
it('errors for invalid `custom``', () => {
|
||||
expect(() => getMatrixForKind("custom", project)).toThrowError();
|
||||
expect(() => getMatrixForKind("custom", project)).toThrow();
|
||||
});
|
||||
})
|
||||
|
||||
@@ -133,6 +133,6 @@ describe('getMatrixForKind for magento-open-source', () => {
|
||||
});
|
||||
|
||||
it('errors for invalid `custom``', () => {
|
||||
expect(() => getMatrixForKind("custom", project)).toThrowError();
|
||||
expect(() => getMatrixForKind("custom", project)).toThrow();
|
||||
});
|
||||
})
|
||||
@@ -8,6 +8,6 @@ describe('validateProject', () => {
|
||||
});
|
||||
|
||||
it('throws a helpful exception if it is an invalid project', () => {
|
||||
expect(() => validateProject(<any>"quark")).toThrowError();
|
||||
expect(() => validateProject(<any>"quark")).toThrow();
|
||||
})
|
||||
})
|
||||
@@ -9,6 +9,6 @@ describe('isKnownProject', () => {
|
||||
});
|
||||
|
||||
it('throws a message if for unknown projects', () => {
|
||||
expect(() => isKnownProject(<Project>"bingo")).toThrowError()
|
||||
expect(() => isKnownProject(<Project>"bingo")).toThrow()
|
||||
});
|
||||
})
|
||||
@@ -35,16 +35,16 @@ describe('parseServicePreferences', () => {
|
||||
});
|
||||
|
||||
it('throws on unknown service name', () => {
|
||||
expect(() => parseServicePreferences('foobar')).toThrowError(/unknown service "foobar"/);
|
||||
expect(() => parseServicePreferences('foobar')).toThrow(/unknown service "foobar"/);
|
||||
});
|
||||
|
||||
it('throws on a collision in the search tier', () => {
|
||||
expect(() => parseServicePreferences('elasticsearch,opensearch')).toThrowError(
|
||||
expect(() => parseServicePreferences('elasticsearch,opensearch')).toThrow(
|
||||
/collision in tier "search"/
|
||||
);
|
||||
});
|
||||
|
||||
it('throws on a collision in the cache tier', () => {
|
||||
expect(() => parseServicePreferences('redis,valkey')).toThrowError(/collision in tier "cache"/);
|
||||
expect(() => parseServicePreferences('redis,valkey')).toThrow(/collision in tier "cache"/);
|
||||
});
|
||||
});
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ describe('validatePreferencesAgainstMatrix', () => {
|
||||
baseEntry({ version: '2.4.7' }),
|
||||
baseEntry({ version: '2.4.5', opensearch: '' }),
|
||||
];
|
||||
expect(() => validatePreferencesAgainstMatrix({ search: 'opensearch' }, entries)).toThrowError(
|
||||
expect(() => validatePreferencesAgainstMatrix({ search: 'opensearch' }, entries)).toThrow(
|
||||
/not satisfied for:\n\s+- magento 2\.4\.5 \(supported: elasticsearch\)/
|
||||
);
|
||||
});
|
||||
@@ -41,14 +41,14 @@ describe('validatePreferencesAgainstMatrix', () => {
|
||||
baseEntry({ version: '2.4.5', opensearch: '' }),
|
||||
baseEntry({ version: '2.4.4', opensearch: '' }),
|
||||
];
|
||||
expect(() => validatePreferencesAgainstMatrix({ search: 'opensearch' }, entries)).toThrowError(
|
||||
expect(() => validatePreferencesAgainstMatrix({ search: 'opensearch' }, entries)).toThrow(
|
||||
/magento 2\.4\.5[\s\S]*magento 2\.4\.4/
|
||||
);
|
||||
});
|
||||
|
||||
it('reports "<none>" when the entry supports nothing in the tier', () => {
|
||||
const entries = [baseEntry({ version: '2.4.0', opensearch: '', elasticsearch: '' })];
|
||||
expect(() => validatePreferencesAgainstMatrix({ search: 'opensearch' }, entries)).toThrowError(
|
||||
expect(() => validatePreferencesAgainstMatrix({ search: 'opensearch' }, entries)).toThrow(
|
||||
/magento 2\.4\.0 \(supported: <none>\)/
|
||||
);
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ describe('getIndividialVersionsForProject', () => {
|
||||
})
|
||||
|
||||
it('throws error if no individual versions are specified for given project', () => {
|
||||
expect(() => getIndividualVersionsForProject(<Project>"ahsoka")).toThrowError()
|
||||
expect(() => getIndividualVersionsForProject(<Project>"ahsoka")).toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -21,6 +21,6 @@ describe('getCompositeVersionsForProject', () => {
|
||||
})
|
||||
|
||||
it('throws error if no composite versions are specified for given project', () => {
|
||||
expect(() => getCompositeVersionsForProject(<Project>"spock")).toThrowError()
|
||||
expect(() => getCompositeVersionsForProject(<Project>"spock")).toThrow()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user