mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
a8b1676734
no issue - There are currently two patterns in our handlebars helper unit tests: 1. Treating the helper as a function, and doing a function call - This is the original way the tests were done, and they're not great as they're approximating how the helpers are really used 2. Using a template string, and rendering the string using a method called shouldCompileToExpected - These tests are more realistic and powerful and also easier to read - The new method is only being used in a few places so far, and each place had re-created the `shouldCompileToExpected` method - Therefore I've moved this method into a util that should make it easier to write unit tests for handlebars helpers - I also renamed the method in the excerpt tests, because it doesn't do the same thing, it's just a wrapper around a function call rather than compiling a string The aim is to refactor all of our handlebars helper tests to use `shouldCompileToExpected` |
||
---|---|---|
.. | ||
content | ||
core | ||
test | ||
.c8rc.json | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.npmignore | ||
config.development.json | ||
ghost.js | ||
index.js | ||
jsconfig.json | ||
loggingrc.js | ||
MigratorConfig.js | ||
package.json |