Skip to content
Snippets Groups Projects
Commit 984b5a89 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(lerna): Use packages path from lerna.json (#542)

parent 434def2b
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,8 @@ async function checkForLerna(config) { ...@@ -36,7 +36,8 @@ async function checkForLerna(config) {
} }
config.logger.debug({ lernaJson }, 'Found lerna config'); config.logger.debug({ lernaJson }, 'Found lerna config');
try { try {
const lernaPackages = await config.api.getSubDirectories('packages'); const packagesPath = lernaJson.packages[0].slice(0, -2);
const lernaPackages = await config.api.getSubDirectories(packagesPath);
if (lernaPackages.length === 0) { if (lernaPackages.length === 0) {
return {}; return {};
} }
......
...@@ -59,7 +59,7 @@ describe('workers/repository/apis', () => { ...@@ -59,7 +59,7 @@ describe('workers/repository/apis', () => {
it('ignores zero length lerna', async () => { it('ignores zero length lerna', async () => {
const config = { const config = {
api: { api: {
getFileJson: jest.fn(() => ({})), getFileJson: jest.fn(() => ({ packages: ['packages/*'] })),
getSubDirectories: jest.fn(() => []), getSubDirectories: jest.fn(() => []),
}, },
logger, logger,
...@@ -70,7 +70,7 @@ describe('workers/repository/apis', () => { ...@@ -70,7 +70,7 @@ describe('workers/repository/apis', () => {
it('returns lerna package names', async () => { it('returns lerna package names', async () => {
const config = { const config = {
api: { api: {
getFileJson: jest.fn(() => ({})), getFileJson: jest.fn(() => ({ packages: ['packages/*'] })),
getSubDirectories: jest.fn(() => ['a', 'b']), getSubDirectories: jest.fn(() => ['a', 'b']),
}, },
logger, logger,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment