-
-
Notifications
You must be signed in to change notification settings - Fork 54
generateTestFile() can generate broken code #142
Comments
We could make a new function |
Maybe we can do something like |
That works too! |
I'm not actually convinced that having If the In other words, implementing the escaping once in each caller is annoying for sure, but it is better than making anyone who overrides the This gets confusing though since the caller is, in a sense, also a hook as it can be invoked by multiple different addons. So I think if we actually want neither party to go through the laborious process of defining escaping logic, then we should upstream it into Ember-CLI (since the |
@Turbo87 what should we do here? Has this come up as an actual issue for someone? |
@trentmwillis at this point I'm no longer sure if the |
I'm unsure I see the value in doing that. I think it makes sense for ember-cli-qunit and ember-cli-mocha to essentially serve as "plugins" for ember-cli-eslint so that way it doesn't need to know about specific test frameworks. As for generating one file, couldn't that be done with the existing implementation? Seems like a |
yeah, I thought so at first too, but it's a little more complicated because we need to deal with both
currently the test generators are generating a test inside a module in each file. if you concat those files you will have a single file but still have one module for each original file. what I would like to have instead is have a single module with one test for each of the files. we could obviously parse the generated JS and extract the test code from the module, but I think it would be much easier to just generate it properly in the first place. |
|
generateTestFile() is not escaping the
moduleName
,errorMessage
and other strings, which can lead to broken code. right now it is the responsibility of the calling code to escape the strings properly, but it really shouldn't be. any ideas how we can change the responsibility without breaking the world?/cc @rwjblue @stefanpenner @trentmwillis
The text was updated successfully, but these errors were encountered: