diff options
author | Marvin Borner | 2018-11-07 22:11:20 +0100 |
---|---|---|
committer | Marvin Borner | 2018-11-07 22:11:20 +0100 |
commit | 641ed66837dd4bd45c977978609fb38cbeac9319 (patch) | |
tree | eec4e367844a7059d29aa2aae086e6c064c03380 /node_modules/qs/test/utils.js | |
parent | 954583f3d56fbfb60321725f13ad092e536e3737 (diff) |
Didn't remove node_modules correctly..
Diffstat (limited to 'node_modules/qs/test/utils.js')
-rw-r--r-- | node_modules/qs/test/utils.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/node_modules/qs/test/utils.js b/node_modules/qs/test/utils.js deleted file mode 100644 index eff4011..0000000 --- a/node_modules/qs/test/utils.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var test = require('tape'); -var utils = require('../lib/utils'); - -test('merge()', function (t) { - t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); - - var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); - t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); - - var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); - t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); - - var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); - t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); - - var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); - t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - - t.end(); -}); - -test('assign()', function (t) { - var target = { a: 1, b: 2 }; - var source = { b: 3, c: 4 }; - var result = utils.assign(target, source); - - t.equal(result, target, 'returns the target'); - t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); - t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); - - t.end(); -}); |