Skip to content

Commit

Permalink
Add unit test for object with methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohnson committed Oct 8, 2017
1 parent ee270bf commit d329e69
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/fixtures/comprehensions/object-methods/actual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
obj = {
a() -> b
...for elem e in arr: {[e]: e}
@decorated
c() -> d
regular: "entry"
e() => f
}
16 changes: 16 additions & 0 deletions test/fixtures/comprehensions/object-methods/expected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const obj = (() => {
const _obj = {
a() {
return b;
},
@decorated
c() {
return d;
}, regular: "entry",
e() {
return f;
} };for (let _i = 0, _len = arr.length; _i < _len; _i++) {
const e = arr[_i];_obj[e] = e;
}return _obj;
})();
obj.e = obj.e.bind(obj);

0 comments on commit d329e69

Please sign in to comment.