Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/test/index.spec.js

Issue 800513006: Added vulcanize under third_party/npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/test/index.spec.js
diff --git a/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/test/index.spec.js b/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/test/index.spec.js
new file mode 100644
index 0000000000000000000000000000000000000000..38974a209a08aee86d9348ae02799d0dfa75b802
--- /dev/null
+++ b/node_modules/vulcanize/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/test/index.spec.js
@@ -0,0 +1,57 @@
+var should = require('should');
+var extend = require('../index');
+
+describe('deep-extend', function() {
+
+ it('can extend on 1 level', function() {
+ var a = { hello: 1 };
+ var b = { world: 2 };
+ extend(a, b);
+ a.should.eql({
+ hello: 1,
+ world: 2
+ });
+ });
+
+ it('can extend on 2 levels', function() {
+ var a = { person: { name: 'John' } };
+ var b = { person: { age: 30 } };
+ extend(a, b);
+ a.should.eql({
+ person: { name: 'John', age: 30 }
+ });
+ });
+
+ it('can extend with Buffer values', function() {
+ var a = { hello: 1 };
+ var b = { value: new Buffer('world') };
+ extend(a, b);
+ a.should.eql({
+ hello: 1,
+ value: new Buffer('world')
+ });
+ });
+
+ it('Buffer is cloned', function () {
+ var a = { };
+ var b = { value: new Buffer('foo') };
+ extend(a, b);
+ a.value.write('bar');
+ a.value.toString().should.eql('bar');
+ b.value.toString().should.eql('foo');
+ });
+
+ it('Date objects', function () {
+ var a = { d: new Date() };
+ var b = extend({}, a);
+ b.d.should.instanceOf(Date);
+ });
+
+ it('Date object is cloned', function () {
+ var a = { d: new Date() };
+ var b = extend({}, a);
+ b.d.setTime( (new Date()).getTime() + 100000 );
+ b.d.getTime().should.not.eql( a.d.getTime() );
+ });
+
+});

Powered by Google App Engine
This is Rietveld 408576698