2024-03-24 20:38:18 +03:00
|
|
|
import {strict as assert} from 'node:assert';
|
|
|
|
import {test} from 'mocha';
|
|
|
|
import {getThirdPartyExtensions} from '../sdk.mjs';
|
2022-01-31 01:09:44 +03:00
|
|
|
|
|
|
|
test('README third party extensions must be alphabetically sorted', async () => {
|
2023-08-08 07:38:52 +03:00
|
|
|
const thirdPartyExtensions = await getThirdPartyExtensions();
|
2022-01-31 01:09:44 +03:00
|
|
|
assert.ok(thirdPartyExtensions.length > 0);
|
|
|
|
|
|
|
|
const thirdPartyExtensionsNames = thirdPartyExtensions.map(
|
2024-03-24 20:38:18 +03:00
|
|
|
(extension) => extension.module.name,
|
2022-01-31 01:09:44 +03:00
|
|
|
);
|
|
|
|
|
2024-03-24 20:38:18 +03:00
|
|
|
const expectedOrder = [...thirdPartyExtensionsNames].sort();
|
2022-01-31 01:09:44 +03:00
|
|
|
assert.deepEqual(
|
|
|
|
thirdPartyExtensionsNames,
|
|
|
|
expectedOrder,
|
|
|
|
'Wrong alphabetical order of third party extensions in README.',
|
|
|
|
);
|
|
|
|
});
|