2024-06-06 14:40:35 +02:00
|
|
|
/**
|
|
|
|
* @file Tests for the documentation.
|
|
|
|
*/
|
|
|
|
|
2024-03-24 19:38:18 +02:00
|
|
|
import {strict as assert} from 'node:assert';
|
|
|
|
import {test} from 'mocha';
|
2024-05-20 13:25:30 +02:00
|
|
|
import {getThirdPartyExtensions, getThirdPartyLibraries} from '../sdk.mjs';
|
2022-01-31 00:09:44 +02:00
|
|
|
|
|
|
|
test('README third party extensions must be alphabetically sorted', async () => {
|
2023-08-08 06:38:52 +02:00
|
|
|
const thirdPartyExtensions = await getThirdPartyExtensions();
|
2022-01-31 00:09:44 +02:00
|
|
|
assert.ok(thirdPartyExtensions.length > 0);
|
|
|
|
|
|
|
|
const thirdPartyExtensionsNames = thirdPartyExtensions.map(
|
2024-03-24 19:38:18 +02:00
|
|
|
(extension) => extension.module.name,
|
2022-01-31 00:09:44 +02:00
|
|
|
);
|
|
|
|
|
2024-03-24 19:38:18 +02:00
|
|
|
const expectedOrder = [...thirdPartyExtensionsNames].sort();
|
2022-01-31 00:09:44 +02:00
|
|
|
assert.deepEqual(
|
|
|
|
thirdPartyExtensionsNames,
|
|
|
|
expectedOrder,
|
|
|
|
'Wrong alphabetical order of third party extensions in README.',
|
|
|
|
);
|
|
|
|
});
|
2024-05-20 13:25:30 +02:00
|
|
|
|
|
|
|
test('README third party libraries must be alphabetically sorted', async () => {
|
|
|
|
const thirdPartyLibraries = await getThirdPartyLibraries();
|
|
|
|
assert.ok(thirdPartyLibraries.length > 0);
|
|
|
|
|
|
|
|
const thirdPartyLibrariesNames = thirdPartyLibraries.map(
|
|
|
|
(library) => library.module.name,
|
|
|
|
);
|
|
|
|
|
|
|
|
const expectedOrder = [...thirdPartyLibrariesNames].sort();
|
|
|
|
assert.deepEqual(
|
|
|
|
thirdPartyLibrariesNames,
|
|
|
|
expectedOrder,
|
|
|
|
'Wrong alphabetical order of third party libraries in README.',
|
|
|
|
);
|
|
|
|
});
|