schmittjoh/twig.js — Issue #5: Failing Test with any version of Twig
Author: weaverryan
Created: 2011-11-26 16:44:56+00:00
State: open

Hey guys!

I'm trying to run the tests, but I can't seem to get them to pass - no matter where I move my Twig library head to. The failure is:

1) TwigJs\Tests\TemplateGenerationTest::testGenerate with data set #2 ('/Users/ryan/Sites/clients/learnernation.com/vendor/twig.js/tests/TwigJs/Tests/Fixture/templates/simple_standalone.twig', '/Users/ryan/Sites/clients/learnernation.com/vendor/twig.js/tests/TwigJs/Tests/Fixture/generated/simple_standalone.js')
Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("There is no compiler for node type "Twig_Node_Expression_Test_Defined".") in "/Users/ryan/Sites/clients/learnernation.com/vendor/twig.js/tests/TwigJs/Tests/Fixture/templates/simple_standalone.twig".

/Users/ryan/Sites/clients/learnernation.com/vendor/twig/lib/Twig/Environment.php:528
/Users/ryan/Sites/clients/learnernation.com/vendor/twig.js/tests/TwigJs/Tests/TemplateGenerationTest.php:25

So, are the tests passing for everyone else? It seems that the TestCompiler isn't visited, so the `JsCompiler::getTestCompiler` is never called (and the test node is used like a normal node).

I was running the tests after one of my templates failed when using a for loop:

[RuntimeException]
There is no compiler for node type "Twig_Node_ForLoop".

Are the tests passing for everyone else? Does the for loop work or does it need some more work?

Thanks! I really like the library - opens a lot of exciting doors.