longshotlabs / meteor-template-extension

A Meteor package: Replace already defined templates, inherit helpers and events from other templates
https://atmospherejs.com/aldeed/template-extension
MIT License
220 stars 20 forks source link

Add tests for copyAs, replaces, hooks, and on. Minor refactor (Fixes #11) #21

Closed jgladch closed 9 years ago

jgladch commented 9 years ago

This rounds out the tests @aldeed has requested in #11.

As I was adding tests, 2 small bugs became apparent so I refactored template-extension.js a bit. All changes tested.

aldeed commented 9 years ago

I don't think the copyAs tests are testing whether helpers are being copied. One simple way would be to change the source template content to <h1>{{copyAsHelper}}</h1>, and define the copyAsHelper that returns "copyAs". That way your tests as written will be implicitly testing that the helper was copied, too.

Otherwise LGTM

jgladch commented 9 years ago

Good catch & suggestion. Updated.