mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42776 Changelog: [Internal] set all monorepo packages (including react-native) to one version and update all inter-dependencies (including the template) Reviewed By: huntie Differential Revision: D53251917 fbshipit-source-id: 95330ca66dcb7234a3f09752ecc3ed9087ced4bf
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
/**
|
|
* 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
|
|
* @format
|
|
*/
|
|
|
|
const setVersion = require('../index');
|
|
const path = require('path');
|
|
|
|
describe('setVersion', () => {
|
|
beforeAll(() => {
|
|
jest.mock('path', () => {
|
|
// $FlowIgnore[underconstrained-implicit-instantiation]
|
|
const originalPath = jest.requireActual('path');
|
|
return {
|
|
...originalPath,
|
|
dirname: () => originalPath.join(__dirname, '__fixtures__/two/levels'),
|
|
};
|
|
});
|
|
|
|
jest.mock('fs', () => {
|
|
// $FlowIgnore[underconstrained-implicit-instantiation]
|
|
const originalFs = jest.requireActual('fs');
|
|
|
|
return {
|
|
...originalFs,
|
|
writeFileSync: (packagePath, content) => {
|
|
expect(content).toMatchSnapshot(
|
|
path.basename(path.join(packagePath, '..')),
|
|
);
|
|
},
|
|
};
|
|
});
|
|
});
|
|
test('updates all public packages to version', () => {
|
|
setVersion('0.80.0');
|
|
});
|
|
afterAll(() => {
|
|
jest.unmock('path');
|
|
jest.unmock('fs');
|
|
});
|
|
});
|