🧪 Testing: Use virtual file system in updateLocalFiles.test.ts #1118
Labels
area: testing
Improving how the repository's tests are run and/or code is tested
status: accepting prs
Please, send a pull request to resolve this!
type: cleanup
Tech debt or other code/repository cleanups
Bug Report Checklist
main
branch of the repository.Overview
#1078 applied some improvements to how find-and-replaces via
replace-in-file
are applied to local files. At the time it was hard to unit test those changes becausereplace-in-file
didn't support a "virtual" (in-memory) file system that tests could use to simulate reading & writing files. A couple of test snapshots now just have[Function]
instead of testing what that function reads & writes:create-typescript-app/src/steps/updateLocalFiles.test.ts
Line 246 in c3f93db
But, good news! adamreisnz/replace-in-file#175 -> adamreisnz/replace-in-file#177 added support for that virtual
fs
toreplace-in-file
. So now the tests should be able to assert on the actual contents of files in memory by providing their ownfs
object!Additional Info
I bet
createJoshuaKGoldbergReplacement.test.ts
could be improved by a virtual file system too...The text was updated successfully, but these errors were encountered: