cypress-autorecord
Version:
It simplifies mocking by auto-recording/stubbing HTTP interactions and automate the process of updating/deleting recordings.
24 lines (22 loc) • 669 B
HTML
<body>
<main>
<h1>cypress-autorecord</h1>
<div>
<pre id="json"></pre>
</div>
</main>
<script>
// var oReq = new XMLHttpRequest();
// oReq.addEventListener('load', function () {
// var json = JSON.parse(this.responseText);
// document.getElementById('json').innerText = JSON.stringify(json);
// });
// oReq.open('GET', 'https://jsonplaceholder.typicode.com/todos/1');
// oReq.send();
fetch('https://jsonplaceholder.typicode.com/todos/1')
.then((response) => response.json())
.then((json) => {
document.getElementById('json').innerText = JSON.stringify(json);
});
</script>
</body>