To run a test:
cd
into a test directory- Run
npx eleventy --config=./.eleventy.js
- Inspect the resulting output —
./_site/index.html
For example:
$ cd ./test/custom-options
$ npx eleventy --config=./.eleventy.js && cat _site/index.html
{
"success": true,
"deck_id": "t14ln4k01167",
"remaining": 52,
"shuffled": true
}
{
"coin": "tails"
}
- Overcome personal gaps in knowledge to understand why throwing errors from within an Eleventy plugin causes
mocha
andnode:test
to hang and not resolve - Implement these tests using a proper test runner