Skip to content

Commit

Permalink
refactor(scripts/monorepo/tests): moved related tests to scripts/mono…
Browse files Browse the repository at this point in the history
…repo/__tests__

Summary:
Changelog: [Internal]
just a small cleanup, moved all tests related to monorepo scripts under `/scripts/monorepo`

Reviewed By: cortinico

Differential Revision: D42308455

fbshipit-source-id: 7743a2af1381ff748556c15b89cf980f8f907674
  • Loading branch information
hoxyq authored and Ruslan Lesiutin committed Jan 24, 2023
1 parent ce9a79e commit 6a3752e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

const {spawnSync} = require('child_process');

const {BUMP_COMMIT_MESSAGE} = require('../monorepo/constants');
const forEachPackage = require('../monorepo/for-each-package');
const findAndPublishAllBumpedPackages = require('../monorepo/find-and-publish-all-bumped-packages');
const {BUMP_COMMIT_MESSAGE} = require('../constants');
const forEachPackage = require('../for-each-package');
const findAndPublishAllBumpedPackages = require('../find-and-publish-all-bumped-packages');

jest.mock('child_process', () => ({spawnSync: jest.fn()}));
jest.mock('../monorepo/for-each-package', () => jest.fn());
jest.mock('../for-each-package', () => jest.fn());

describe('findAndPublishAllBumpedPackages', () => {
it('throws an error if updated version is not 0.x.y', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const path = require('path');
const {readdirSync, readFileSync} = require('fs');

const forEachPackage = require('../monorepo/for-each-package');
const forEachPackage = require('../for-each-package');

jest.mock('fs', () => ({
readdirSync: jest.fn(),
Expand All @@ -32,7 +32,7 @@ describe('forEachPackage', () => {
forEachPackage(callback);

expect(callback).toHaveBeenCalledWith(
path.join(__dirname, '..', '..', 'packages', mockedPackageName),
path.join(__dirname, '..', '..', '..', 'packages', mockedPackageName),
path.join('packages', mockedPackageName),
mockedParsedPackageManifest,
);
Expand Down

0 comments on commit 6a3752e

Please sign in to comment.