Skip to content

Commit

Permalink
Merge pull request #422 from ljharb/fix_descriptor_tests
Browse files Browse the repository at this point in the history
Fix `ownPropertyDescriptor` tests
  • Loading branch information
keithamus committed Apr 7, 2015
2 parents 0faad59 + 517d463 commit 55c5153
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Makefile
Expand Up @@ -55,6 +55,11 @@ test-phantom: build
@./node_modules/karma/bin/karma start \
--single-run --browsers PhantomJS

test-firefox: build
@printf "==> [Test :: Karma (Firefox)]\n"
@./node_modules/karma/bin/karma start \
--browsers Firefox

test-sauce: build
@printf "==> [Test :: Karma (Sauce)]\n"
@CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -42,6 +42,7 @@
"karma-mocha": "*",
"karma-sauce-launcher": "0.2.x",
"karma-phantomjs-launcher": "0.1.1",
"karma-firefox-launcher": "^0.1.4",
"mocha": "1.21.x",
"istanbul": "0.2.x"
}
Expand Down
4 changes: 2 additions & 2 deletions test/expect.js
Expand Up @@ -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,
Expand All @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions test/should.js
Expand Up @@ -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,
Expand All @@ -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');
Expand Down

0 comments on commit 55c5153

Please sign in to comment.