   test "formatStrikeThrough", (expectDocument) ->
     insertString("abc")
     getComposition().setSelectedRange([1, 2])
-    performInputTypeUsingExecCommand("strikeThrough", inputType: "formatStrikeThrough")
-    defer ->
+    performInputTypeUsingExecCommand "strikeThrough", inputType: "formatStrikeThrough", ->
       assert.textAttributes([0, 1], {})
       assert.textAttributes([1, 2], strike: true)
       assert.textAttributes([2, 3], {})

    inputEvents.push({type, inputType, data})

# Borrowed from https://github.com/web-platform-tests/wpt/blob/master/input-events/input-events-exec-command.html
performInputTypeUsingExecCommand = (command, {inputType, data}) ->
  inputEvents = []
  triggerInputEvent(document.activeElement, "beforeinput", {inputType, data})
  document.execCommand(command, false, data)
  assert.equal(inputEvents.length, 2)
  assert.equal(inputEvents[0].type, "beforeinput")
  assert.equal(inputEvents[1].type, "input")
  assert.equal(inputEvents[0].inputType, inputType)
  assert.equal(inputEvents[0].data, data)

testGroup "Level 2 Input", testOptions, ->
  test "insertText", (expectDocument) ->
    performInputTypeUsingExecCommand("insertText", inputType: "insertText", data: "abc")
    defer ->
      expectDocument("abc\n")

  test "insertOrderedList", (expectDocument) ->
    insertString("abc")
    performInputTypeUsingExecCommand("insertOrderedList", inputType: "insertOrderedList")
    defer ->
      assert.blockAttributes([0, 4], ["numberList", "number"])
      assert.ok isToolbarButtonActive(attribute: "number")
      expectDocument("abc\n")

  test "insertUnorderedList", (expectDocument) ->
    insertString("abc")
    performInputTypeUsingExecCommand("insertUnorderedList", inputType: "insertUnorderedList")
    defer ->
      assert.blockAttributes([0, 4], ["bulletList", "bullet"])
      assert.ok isToolbarButtonActive(attribute: "bullet")
      expectDocument("abc\n")

  test "formatItalic", (expectDocument) ->
    insertString("abc")
    getComposition().setSelectedRange([1, 2])
    performInputTypeUsingExecCommand "italic", inputType: "formatItalic", ->
      assert.textAttributes([0, 1], {})
      assert.textAttributes([1, 2], italic: true)
      assert.textAttributes([2, 3], {})
