Skip to content

Commit

Permalink
test: move mergeAll test to merge-all test file
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jan 23, 2021
1 parent 5e302aa commit cddd823
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 12 additions & 0 deletions test/merge-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,15 @@ test('invoke merge on every item in array without clone should clone all element

t.end()
})

test('With clone: false, mergeAll should not clone the target root', t => {
const destination = {}
const output = mergeAll([
destination, {
sup: true
}
], { clone: false })

t.equal(destination, output)
t.end()
})
13 changes: 1 addition & 12 deletions test/merge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { deepmerge as merge, deepmergeAll as mergeAll } from "deepmerge"
import { deepmerge as merge } from "deepmerge"
import test from "tape"

test('add keys in target that do not exist at the root', function(t) {
Expand Down Expand Up @@ -687,14 +687,3 @@ test('With clone: false, merge should not clone the target root', t => {
t.end()
})

test('With clone: false, merge.all should not clone the target root', t => {
const destination = {}
const output = mergeAll([
destination, {
sup: true
}
], { clone: false })

t.equal(destination, output)
t.end()
})

0 comments on commit cddd823

Please sign in to comment.