The only additional change in this PR is to move code unrelated to the async operations out of the scope of the promise code.
I looked for a place to add tests to verify, but all of the test fixtures in the repository were more granular than this specific change. All current tests pass, though.
The core of this PR is to switch from calling jstransformer's
renderFile
function to instead callingrenderFileAsync
. Because of the sync fallback support in jstransformer (https://github.com/jstransformers/jstransformer/blob/69fd94c47500fe4d4c8d9f1ac2918c2a55075db0/index.js#L345), calling the async function should work for both async and sync template engines.The only additional change in this PR is to move code unrelated to the async operations out of the scope of the promise code.
I looked for a place to add tests to verify, but all of the test fixtures in the repository were more granular than this specific change. All current tests pass, though.