Michael Spector
09/05/2023, 2:51 PMMatcherV3.timestamp
?
in the documentation (V3 Matching Rules) it shows that timestamp
can be used without a second argument representing an example.
however, when I try using it without an example, it throws the error you must provide an example timestamp
the code and documentation talk about "generators" - do I need to specify that somehow?
(I'll post a code snippet in thread)Michael Spector
09/05/2023, 2:52 PMconst expectedResponse = {
fully_updated: boolean(true),
run_sets: eachLike([
{
submission_timestamp: timestamp("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"),
last_modified_timestamp: timestamp("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"),
},
], { min: 1 }),
};
await cbasPact.addInteraction({
states: [{ description: 'at least one run set exists with method_id 00000000-0000-0000-0000-000000000009' }],
uponReceiving: 'get run set with method_id=00000000-0000-0000-0000-000000000009 and page_size=1',
withRequest: { method: 'GET', path: '/api/batch/v1/run_sets', query: { method_id: '00000000-0000-0000-0000-000000000009', page_size: 1 } },
willRespondWith: { status: 200, body: expectedResponse },
});
Yousaf Nabi (pactflow.io)
Michael Spector
09/05/2023, 3:38 PMString value that must match the provided datetime format string. See Java SimpleDateFormat for details on the format string. If the example value is omitted, a value will be generated using a Timestamp generator and the current system date and time.
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Michael Spector
09/07/2023, 1:04 PMwould you be up for a PR to help address it?potentially - I don't want to commit just yet (I've solved my immediate problem with a regex), but if I do, I'll post again in this thread, find the contributor guidelines, and take it from there. I agree option (1) would be ideal