-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: initial conversion of test to typescript
- Loading branch information
1 parent
aebb6ba
commit 9ce11e4
Showing
8 changed files
with
53 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/custom-is-mergeable-object.js → test/custom-is-mergeable-object.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 34 additions & 34 deletions
68
test/merge-plain-objects.js → test/merge-plain-objects.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
var merge = require('../') | ||
var test = require('tape') | ||
|
||
test('plain objects are merged by default', function(t) { | ||
const input = { | ||
newObject: new Object(), | ||
objectLiteral: { a: 123 } | ||
} | ||
const output = merge({}, input) | ||
|
||
t.deepEqual(output.newObject, input.newObject) | ||
t.notEqual(output.newObject, input.newObject) | ||
t.deepEqual(output.objectLiteral, input.objectLiteral) | ||
t.notEqual(output.objectLiteral, input.objectLiteral) | ||
|
||
t.end() | ||
}) | ||
|
||
test('instantiated objects are copied by reference', function(t) { | ||
const input = { | ||
date: new Date(), | ||
error: new Error(), | ||
regex: /regex/ | ||
} | ||
const output = merge({}, input) | ||
|
||
t.equal(output.date, input.date) | ||
t.equal(output.error, input.error) | ||
t.equal(output.regex, input.regex) | ||
|
||
t.end() | ||
}) | ||
|
||
import { deepmerge as merge } from "deepmerge" | ||
import test from "tape" | ||
|
||
test('plain objects are merged by default', function(t) { | ||
const input = { | ||
newObject: new Object(), | ||
objectLiteral: { a: 123 } | ||
} | ||
const output = merge({}, input) | ||
|
||
t.deepEqual(output.newObject, input.newObject) | ||
t.notEqual(output.newObject, input.newObject) | ||
t.deepEqual(output.objectLiteral, input.objectLiteral) | ||
t.notEqual(output.objectLiteral, input.objectLiteral) | ||
|
||
t.end() | ||
}) | ||
|
||
test('instantiated objects are copied by reference', function(t) { | ||
const input = { | ||
date: new Date(), | ||
error: new Error(), | ||
regex: /regex/ | ||
} | ||
const output = merge({}, input) | ||
|
||
t.equal(output.date, input.date) | ||
t.equal(output.error, input.error) | ||
t.equal(output.regex, input.regex) | ||
|
||
t.end() | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.