Files
vercel/packages/now-python/test/fixtures/14-unicode-handler/probe.js
2020-04-28 09:11:46 -04:00

20 lines
561 B
JavaScript

module.exports = async function({ deploymentUrl, fetch }) {
const nowjson = require('./now.json');
const probe = nowjson.probes[0];
const probeUrl = `https://${deploymentUrl}${probe.path}`;
const resp = await fetch(probeUrl, {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify(probe.body),
});
const text = await resp.text();
const respBody = JSON.parse(text);
if (respBody.greeting !== 'hello, Χριστοφορε') {
throw new Error(`unexpected response: ${respBody}`);
}
};