Skip to content

Commit

Permalink
FIX (mocks): deep duplicate mock so changes don't propagate (#284)
Browse files Browse the repository at this point in the history
Otherwise editing the duplicate will change the original one and vice versa.
  • Loading branch information
Max Voronov authored and morsdyce committed Apr 25, 2021
1 parent ac11543 commit a12e508
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class Mocks {
const mock = this.find({ id: mockId });

const duplicatedMock = {
...omit(mock, ['id']),
...omit(cloneDeep(mock), ['id']),
name: mock.name ? `${mock.name} Copy` : mock.name,
groupId: mock.groupId,
...overrides
Expand Down

0 comments on commit a12e508

Please sign in to comment.