public
public copied to clipboard
feature request: enable write back from cache
Tests and code can create artifacts when they run. For example:
- https://github.com/unional/komondor creates spec records in the
__komondor__
folder - https://github.com/unional/fixture creates result and baseline files
When running in wallaby, the tests run fine because the files are saved in the cache.
But that means the tests fail when running again from CLI because the actual files were not written.
Is it possible to specify writeback: true
in the file object?
i.e.:
{
'files': [
{ pattern: '...', writeback: true }
]
}
🌷
I like the idea of providing such a flag.
Also, even though it's not a one flag solution, but before the feature is implemented, you may write any files back to the local project dir by intercepting and extending the function that writes the files. An example may be found here.
I notice two things:
file.replace(wallaby.projectCacheDir, wallaby.localProjectDir)
creates an incorrect path.
e.g. /Users/hwong/code/project-a//__komondor/...
.
Note the double //
there.
Doing path.join(wallaby.localProjectDir, file.replace(wallaby.projectCacheDir, ''))
solves the issue, but it is ugly.
Another thing probably also needs to patch fs.mkdirSync()
because it is giving me:
Failed: ENOENT: no such file or directory, open
'/Users/hwong/code/project-a/__komondor__/specs/objects/addresses/move/before.json'