Skip to content

Commit e03b01f

Browse files
committed
Prep unit tests & coverage
1 parent 6723d55 commit e03b01f

6 files changed

Lines changed: 733 additions & 96 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
eleventy-test-out/
3-
coverage/
3+
# Tests
4+
.nyc_output/

11tyAutoCacheBuster.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,12 @@ module.exports = function(eleventyConfig, options=defaultOptions) {
186186
});
187187
}
188188
}
189+
190+
this.functions = {
191+
_logColour, logRegular, logGreen, logRed, logYellow,
192+
hash,
193+
writeSync, writeAsync,
194+
collectLocalAssets,
195+
replaceAssetsInFile,
196+
stripPath
197+
}

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,29 @@
1212
"packageManager": "pnpm@10.32.1+sha256.9b943b94bc8f55efb993aad8e44b538e6b091e60a9e4a944dcde869855f233e3",
1313
"scripts": {
1414
"start": "pushd tests/scenarios/8-sync@3 && eleventy && popd",
15-
"test": "c8 ava tests/test.mjs --timeout=30s"
15+
"test": "pnpm test:unit && pnpm test:integration",
16+
"test:unit": "nyc ava tests/unit.js",
17+
"test:integration": "ava tests/integration.mjs --timeout=30s"
1618
},
1719
"dependencies": {
1820
"escape-string-regexp": "^5.0.0",
1921
"glob": "^13.0.6"
2022
},
23+
"pnpm": {
24+
"overrides": {
25+
"make-dir": "3.1.0",
26+
"semver": "^7.7.4"
27+
}
28+
},
2129
"devDependencies": {
2230
"@11ty/eleventy": "^3.1.2",
2331
"@11ty/eleventy3.1.5": "npm:@11ty/eleventy@3.1.5",
2432
"@codestitchofficial/eleventy-plugin-minify": "^1.1.3",
2533
"ava": "^7.0.0",
26-
"c8": "^11.0.0",
2734
"eleventy-test": "^2.0.1",
2835
"html-minifier-terser": "^7.2.0",
2936
"jsdom": "^28.1.0",
37+
"nyc": "^18.0.0",
3038
"rss-parser": "^3.13.0"
3139
}
3240
}

0 commit comments

Comments
 (0)