1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/lib/services/plugins/utils/validatePluginPlatforms.test.ts

18 lines
603 B
TypeScript

import validatePluginPlatforms from './validatePluginPlatforms';
describe('validatePluginPlatforms', () => {
test.each([
[['mobile', 'desktop'], true],
['not-an-array', false],
[[3, 4, 5], false],
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
])('should throw when given an invalid list of supported plugin platforms (case %#)', (platforms: any, shouldSupport) => {
const callback = () => validatePluginPlatforms(platforms);
if (shouldSupport) {
expect(callback).not.toThrow();
} else {
expect(callback).toThrow();
}
});
});