Permalink
Browse files

Fix PropertyMethodAssignment test (#2134)

The test was testing the name of a method. With newer versions of
Node, Node uses the ES6 semantics for inferring the function name
which leads to test failures.
  • Loading branch information...
1 parent 9702f43 commit fea68205797fda83666d20020afedc0b2077f322 @arv arv committed on GitHub Sep 11, 2016
Showing with 3 additions and 1 deletion.
  1. +3 −1 test/feature/PropertyMethodAssignment/PropertyMethodAssignment.js
@@ -41,7 +41,9 @@ function assertMethod(object, name) {
assert.isTrue(descriptor.enumerable);
assert.equal('function', typeof object[name]);
// IE does not have a name property on functions.
- assert.isTrue(object[name].name === '' || object[name].name === undefined);
+ // ES6 compliant engines will set the name of {x: function() {}} to x
+ var fn = object[name].name;
+ assert.include(['', undefined, name], fn);
}
assertMethod(object, 'f');

0 comments on commit fea6820

Please sign in to comment.