Skip to content

Commit

Permalink
test(utils/decorator): returning a newly created member descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
buschtoens committed Dec 11, 2018
1 parent d23ede7 commit b0a199f
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ module('decorator helpers', function() {

new Foo();
});

test('it works with returning a newly created member descriptor', function(assert) {
let decorate = decoratorWithParams(desc => {
return {
...desc,
descriptor: {
configurable: desc.configurable,
enumerable: desc.enumerable,
get() {
return 1337;
}
}
}
});

class Foo {
@decorate() foo() {}
}

let foo = new Foo();
assert.strictEqual(foo.foo, 1337);
});
});

module('decoratorWithRequiredParams', function() {
Expand Down

0 comments on commit b0a199f

Please sign in to comment.