Zearin / eleventy-plugin-pug

Pug templates for Eleventy 3! (PRE-ALPHA; NOT READY FOR USE)
MIT License
3 stars 1 forks source link

Fix data function test #3

Closed Aankhen closed 2 months ago

Aankhen commented 2 months ago

The data file needed to export a function that returns a function.

I replaced the macOS-specific TRASH code with rmdirSync and added the output directories to .gitignore. I think there’s still something wrong with how I’m running the tests, though, because running npx eleventy in the stub directories shows me the right results but the tests for those stubs always say Eleventy produced no files, which I confirmed afterwards.

I wasn’t able to get the Eleventy output by passing ndjson to executeBuild, either.

P.S.: Would you consider adding a .prettierrc.yaml? I had the devil of a time forcing tabs instead of spaces, not to mention maintaining the rest of your style, and I think that might be because Prettier has its own defaults. 😅

Zearin commented 2 months ago

Whoops! It looks like I missed this. (I’m used to creating PRs, but not receiving them.) Sorry about that.

Aankhen commented 2 months ago

No problem, it happens. I’ve opened #4 for the .gitignore addition.

I wrote my hack-y “move to .Trash” function because I accidentally resolved the wrong directory one time and deleted the entire test folder! 🤦🏽‍♂️ I am still feeling a bit over-cautious about using rmdir*() until this project becomes more mature.

How about using the tmp package to generate output directories, then? It can automatically remove them when the process exits.