We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7c3973 commit 615b581Copy full SHA for 615b581
test/functions/inc.js
@@ -10,10 +10,20 @@ test('increment versions test', (t) => {
10
t.equal(found, wanted, `${cmd} === ${wanted}`)
11
12
const parsed = parse(pre, options)
13
+ const parsedAsInput = parse(pre, options)
14
if (wanted) {
15
parsed.inc(what, id)
16
t.equal(parsed.version, wanted, `${cmd} object version updated`)
17
t.equal(parsed.raw, wanted, `${cmd} object raw field updated`)
18
+
19
+ const preIncObject = JSON.stringify(parsedAsInput)
20
+ inc(parsedAsInput, what, options, id)
21
+ const postIncObject = JSON.stringify(parsedAsInput)
22
+ t.equal(
23
+ postIncObject,
24
+ preIncObject,
25
+ `${cmd} didn't modify its input`
26
+ )
27
} else if (parsed) {
28
t.throws(() => {
29
0 commit comments