From 517d46392f746adc06a516ba8db9169f0134e362 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 6 Apr 2015 23:51:57 -0700 Subject: [PATCH] Use a regex to account for property ordering issues across engines. --- test/expect.js | 4 ++-- test/should.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/expect.js b/test/expect.js index f41e81bd3..d504a8eaf 100644 --- a/test/expect.js +++ b/test/expect.js @@ -547,7 +547,7 @@ describe('expect', function () { expect(obj).to.have.ownPropertyDescriptor('test', descriptor); err(function(){ expect(obj).not.to.have.ownPropertyDescriptor('test', descriptor, 'blah'); - }, "blah: expected the own property descriptor for 'test' on { test: NaN } to not match { configurable: false,\n enumerable: true,\n writable: true,\n value: NaN }"); + }, /^blah: expected the own property descriptor for 'test' on \{ test: NaN \} to not match \{ [^\}]+ \}$/); err(function(){ var wrongDescriptor = { configurable: false, @@ -556,7 +556,7 @@ describe('expect', function () { value: NaN }; expect(obj).to.have.ownPropertyDescriptor('test', wrongDescriptor, 'blah'); - }, "blah: expected the own property descriptor for 'test' on { test: NaN } to match { configurable: false,\n enumerable: true,\n writable: false,\n value: NaN }, got { value: NaN,\n writable: true,\n enumerable: true,\n configurable: false }"); + }, /^blah: expected the own property descriptor for 'test' on \{ test: NaN \} to match \{ [^\}]+ \}, got \{ [^\}]+ \}$/); err(function(){ expect(obj).to.have.ownPropertyDescriptor('test2', 'blah'); diff --git a/test/should.js b/test/should.js index a1a829ffd..58300d4bd 100644 --- a/test/should.js +++ b/test/should.js @@ -412,7 +412,7 @@ describe('should', function() { obj.should.haveOwnPropertyDescriptor('test', descriptor); err(function(){ obj.should.not.haveOwnPropertyDescriptor('test', descriptor, 'blah'); - }, "blah: expected the own property descriptor for 'test' on { test: NaN } to not match { configurable: false,\n enumerable: true,\n writable: true,\n value: NaN }"); + }, /^blah: expected the own property descriptor for 'test' on \{ test: NaN \} to not match \{ [^\}]+ \}$/); err(function(){ var wrongDescriptor = { configurable: false, @@ -421,7 +421,7 @@ describe('should', function() { value: NaN }; obj.should.haveOwnPropertyDescriptor('test', wrongDescriptor, 'blah'); - }, "blah: expected the own property descriptor for 'test' on { test: NaN } to match { configurable: false,\n enumerable: true,\n writable: false,\n value: NaN }, got { value: NaN,\n writable: true,\n enumerable: true,\n configurable: false }"); + }, /^blah: expected the own property descriptor for 'test' on \{ test: NaN \} to match \{ [^\}]+ \}, got \{ [^\}]+ \}$/); err(function(){ obj.should.haveOwnPropertyDescriptor('test2', 'blah');