mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
* fix: add repository metadata to all packages * empty commit for cla bot * move validate-package-json.test.ts + add glob devDependency Co-authored-by: slorber <lorber.sebastien@gmail.com>
32 lines
1 KiB
TypeScript
32 lines
1 KiB
TypeScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import util from 'util';
|
|
import globCb from 'glob';
|
|
import fsCb from 'fs';
|
|
|
|
const glob = util.promisify(globCb);
|
|
const readFile = util.promisify(fsCb.readFile);
|
|
|
|
describe('packages', () => {
|
|
test('should contain repository and directory for every package', async () => {
|
|
const allPackageJson = await glob('packages/*/package.json');
|
|
expect(allPackageJson.length).toBeGreaterThan(0);
|
|
|
|
/* eslint-disable no-await-in-loop,no-restricted-syntax */
|
|
for (const packageJson of allPackageJson) {
|
|
const content = JSON.parse(await readFile(packageJson, 'utf8'));
|
|
if (content.private !== true) {
|
|
expect(content.repository).toEqual({
|
|
type: 'git',
|
|
url: 'https://github.com/facebook/docusaurus.git',
|
|
directory: packageJson.replace(/\/package\.json$/, ''),
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|