Closed mlafeldt closed 2 years ago
Hey! Can you share what the files would look like for your Go project? Just to understand better where you are coming from 😁
Sure, for example, https://github.com/mlafeldt/dilbert-feed/tree/main/src/bin/get-strip/testdata contains some HTML files that, when served, mimic dilbert.com.
e.g. /strip/2020-11-11
is the same as https://dilbert.com/strip/2020-11-11
This applies to all files in that folder when testdata
is the server's root folder.
$ tree testdata/
testdata/
└── strip
├── 2000-01-01
├── 2018-10-30
├── 2019-11-02
└── 2020-11-11
1 directory, 4 files
Sorry for the late reply, catching up with all things OSS this week 😅
include_str
is indeed what I would have recommended - I don't think we are going to provide first-class support in wiremock
for the time being.
Hey,
I recently ported one of my Go apps to Rust. I was happy to discover wiremock along the way, which has served me very well so far. Thanks! 👏
One feature I do miss from Go's httptest package though is the ability to easily serve all test files contained in a folder, e.g.
With wiremock, the best I could come up with was to read files one by one depending on the test:
However, I didn't like that solution and ended up using
include_str
instead.Maybe there's a simpler way I'm missing here?
Or maybe it's a sensible feature request. 😀