canjs / steal-stache

A plugin that allows you to import stache templates with stealjs.
https://canjs.com/doc/steal-stache.html
MIT License
4 stars 2 forks source link

WIP: include filename in stache() call #44

Closed christopherjbaker closed 7 years ago

christopherjbaker commented 7 years ago

reminder: bump can-stache dependecy

christopherjbaker commented 7 years ago

Other than creating a stache that has a parsing error and making sure the error has the filename, any suggestions on how to test this? Do we have a simplish way to mock the require('stache')?

phillipskevin commented 7 years ago

You can use steal-clone. Something like this should work:

    function fakeStache() {
        // check that the filename is passed
    }

    clone({
        'can-stache': {
            default: fakeStache
        }
    })
    .import('test/tests/foo.stache')
    .then(...);