Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const write = require("../../src/dependency_inversion/response_writer");
const toXml = require("../../src/dependency_inversion/xml_serializer");
const toHtml = require("../../src/dependency_inversion/html_serializer");
const toString = require("../../src/dependency_inversion/string_serializer");
describe('response writer outputs', () => {
it('outputs XML when selected', () => {
expect(write({name:""}, toXml)).toMatch("<customer>");
})
it('outputs HTML when selected', () => {
expect(write({name:""}, toHtml)).toMatch("<html>");
})
it('outputs as string when selected', () => {
expect(write({name:""}, toString)).toMatch("Customer:");
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.