Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having trouble running the test #2

Open
sanfordredlich opened this issue May 19, 2013 · 5 comments
Open

Having trouble running the test #2

sanfordredlich opened this issue May 19, 2013 · 5 comments
Assignees

Comments

@sanfordredlich
Copy link

Hi, thanks for working on this. I'd like to add the ability to compile Jade in the Handlebars templates.

To do this, I plan to add this code, which worked fine for me when done directly in the code:

cd ember-handlebars-brunch/
npm install --save jade
add this to index.js
jade = require('jade');
…
var content, error, result, tmplName, tmplPath, 
...
jadeOutput;
if (this.precompile === true) {
          jadeOutput = jade.compile(data.toString(), {
            compileDebug: true,
            filename: tmplPath
          });

 content = compileHBS(jadeOutput());

In trying to do this, I had trouble running the tests. My steps were

git clone https://github.com/bartsqueezy/ember-handlebars-brunch.git
cd ember-handlebars-brunch/
npm install
npm test

result: "error: cannot find module 'handlebars'"

So I updated test/plugin_test.js to have this:
"var Handlebars = require('../vendor/handlebars');"

Then I get this error:
" 1) plugin "before each" hook:
typeerror: cannot read property 'templates' of undefined
at new emberhandlebarscompiler (/users/s.redlich/documents/testembertoss/ember-handlebars-brunch/lib/index.js:26:28)"

Questions:

  • Am I on the right track or am I just running the the tests incorrectly?
  • Is there a graceful way to add the Jade precompilation step without forking ember-handlebars-brunch? I was hoping that Brunch could do multiple precompilation steps in a series but I don't see a way to do that.

Thanks for any tips,

  • Sanford
@bartsqueezy
Copy link
Owner

@sanfordredlich, the unit tests for this plugin have not been kept up-to-date for quite some time now. Updating existing and creating new tests was the next thing on my to-do list for this week. Obviously, adding support for Jade within Handlebars templates would require modifying these tests, if not creating new ones altogether.

I'll start looking into these errors your having tonight and let you know what I come up. Thanks!

@sanfordredlich
Copy link
Author

Cool, thanks for any help. I haven't looked at this before so I wasn't even sure what the proper procedure is for running the tests (npm test?). My other key question is: "Is there a graceful way to add the Jade precompilation step without forking ember-handlebars-brunch? I was hoping that Brunch could do multiple precompilation steps in a series but I don't see a way to do that." I assume there isn't a way to chain precompilation steps, so the only way I can add Jade is to fork this code and add it per my note above. Is that correct? Thanks, - S.

@sanfordredlich
Copy link
Author

PS - I'm back on the internet after traveling so I should be able to respond more quickly.

@bartsqueezy
Copy link
Owner

Looks like we've been playing tag. Just got back myself from a week of travel. Picking up where I left off on this. Sorry for the wait.

@ghost ghost assigned bartsqueezy Jun 3, 2013
@sanfordredlich
Copy link
Author

No worries, Steve, thanks. I'm actually diving into Angular research at the moment and I'm still in Berlin, so we're in tune. ;)

  • S.

On Jun 3, 2013, at 6:33 AM, Steve Bartnesky [email protected] wrote:

Looks like we've been playing tag. Just got back myself from a week of travel. Picking up where I left off on this. Sorry for the wait.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants