Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(Medium) - Decouple Side-Effects
QUnit.test('Query the posts title given some HTML server response', (assert) => {
const getRequest = (url) => {
return Promise.resolve(`
<h1 class="post-title">How to bake a cake</h1>
const httpServerDataSource = HttpServerDataSource(getRequest);
return httpServerDataSource.findPostsTitle().then((postsTitle) => {
assert.deepEqual(postsTitle, ['How to bake a cake']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment