Files
side-by-side/source/scripts/tests/reader/json.coffee
T
Vit Brunner ff0bd79c53 Reduce duplication
Some would also say it'd be a good idea not to put random stuff in the
global namespace. One day I'll figure it out.
2013-06-11 08:59:31 +01:00

30 lines
973 B
CoffeeScript

test("jsonReader", () ->
testCases = [{
tested: """
{
meta: {
Title: "Test leading text"
},
content: [
"<p><strong>This</strong> is leading text.</p>",
{ section: "I", text: "<p>First section.</p>" },
{ section: "II", text: "<p>Second section.</p>" },
{ text: "<p>Another section.</p>" },
],
}"""
expected: {
meta: {
Title: "Test leading text"
}
content: [
{ section: "", text: "<p><strong>This</strong> is leading text.</p>" }
{ section: "I", text: "<p>First section.</p>" }
{ section: "II", text: "<p>Second section.</p>" }
{ section: "", text: "<p>Another section.</p>" }
]
}
}]
testReader("jsonReader", testCases)
)