/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/debugger-shell/__tests__/electron-dependency-test.js
41 строка
1 KB
Moti Zilberman
Demote `electron` to devDependency (#53438)
27 авг 2025, 12:50
27 авг 2025, 12:50
ba24f5f
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ 'use strict'; const semver = require('semver'); // This test ensures that the electron dependency declared in our package.json // is semver-satisfied by the actual version of the electron package we're using. // While this is normally the job of a package manager like Yarn, in our case we // may use Yarn forced resolutions that defeat versioning, so we want additional // safety to ensure the target of the resolution is in sync with the declared dependency. describe('Electron dependency', () => { test('should be semver-satisfied by the actual electron version', () => { // $FlowFixMe[untyped-import] - package.json is not typed const ourPackageJson = require('../package.json'); const declaredElectronVersion = ourPackageJson.devDependencies.electron; expect(declaredElectronVersion).toBeTruthy(); // $FlowFixMe[untyped-import] - package.json is not typed const electronPackageJson = require('electron/package.json'); const actualElectronVersion = electronPackageJson.version; expect(actualElectronVersion).toBeTruthy(); const isSatisfied = semver.satisfies( actualElectronVersion, declaredElectronVersion, ); expect(isSatisfied).toBe(true); }); });