Support plugins that contain a scope in their name (#1427)

Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/1427

Reviewed By: mweststrate

Differential Revision: D22868784

fbshipit-source-id: c332e5b05e3fccb74cf5fdcdecf15b8f2e8c5006
This commit is contained in:
Anton Nikolaev
2020-08-04 10:50:45 -07:00
committed by Facebook GitHub Bot
parent 14e6b1078d
commit 7e84c8e880
3 changed files with 36 additions and 12 deletions

View File

@@ -48,6 +48,15 @@ test('valid package json', async () => {
expect(result).toBe(null);
});
test('valid scoped package json', async () => {
const testPackageJson = Object.assign({}, validPackageJson);
testPackageJson.name = '@test/flipper-plugin-package';
const json = JSON.stringify(testPackageJson);
fs.readFile = jest.fn().mockResolvedValue(new Buffer(json));
const result = await runLint('dir');
expect(result).toBe(null);
});
test('$schema field is required', async () => {
const testPackageJson = Object.assign({}, validPackageJson);
delete testPackageJson.$schema;