Skip to content

Commit

Permalink
fix(lift): stop duplicating the original results when lifting the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Jan 28, 2025
1 parent f077768 commit 5603020
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/lift.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import deepmerge from 'deepmerge';
import {applyEnhancers} from '@form8ion/core';
import {lift as liftReadme} from '@form8ion/readme';
import * as gitPlugin from '@form8ion/git';
Expand All @@ -13,7 +12,7 @@ export default async function ({projectRoot, results, enhancers, vcs, dependenci
dependencies
});

await liftReadme({projectRoot, results: deepmerge.all([results, enhancerResults])});
await liftReadme({projectRoot, results: enhancerResults});

return enhancerResults;
}
5 changes: 1 addition & 4 deletions src/lift.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import deepmerge from 'deepmerge';
import * as core from '@form8ion/core';
import * as readme from '@form8ion/readme';
import * as gitPlugin from '@form8ion/git';
Expand Down Expand Up @@ -26,7 +25,6 @@ describe('lift', () => {
const vcs = any.simpleObject();
const results = any.simpleObject();
const enhancerResults = any.simpleObject();
const mergedResults = any.simpleObject();
when(core.applyEnhancers)
.calledWith({
results,
Expand All @@ -35,9 +33,8 @@ describe('lift', () => {
dependencies
})
.mockResolvedValue(enhancerResults);
when(deepmerge.all).calledWith([results, enhancerResults]).mockReturnValue(mergedResults);

expect(await lift({projectRoot, results, enhancers, vcs, dependencies})).toEqual(enhancerResults);
expect(readme.lift).toHaveBeenCalledWith({projectRoot, results: mergedResults});
expect(readme.lift).toHaveBeenCalledWith({projectRoot, results: enhancerResults});
});
});

0 comments on commit 5603020

Please sign in to comment.