insert_before_test.dart 480 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import 'dart:sky';

import 'package:test/test.dart';

void main() {
  Document document = new Document();

  test("should throw with invalid arguments", () {
    var parent = document.createElement("div");
    var child = document.createElement("div");
    parent.appendChild(child);
    // TODO(eseidel): This should throw!
    // expect(() {
    //   parent.insertBefore([parent]);
    // }, throws);
    expect(() {
      child.insertBefore([parent]);
    }, throws);
  });

}