Changes between Version 7 and Version 8 of WebInspectorTests


Ignore:
Timestamp:
Aug 29, 2017 3:45:36 PM (5 years ago)
Author:
Nikita Vasilyev
Comment:

List assertion matchers. They are hard to find otherwise.

Legend:

Unmodified
Added
Removed
Modified
  • WebInspectorTests

    v7 v8  
    6767* Use `expectThat` instead of `assert` whenever possible. The former will always add output to the test, prefixing the condition with `PASS:` or `FAIL:`; the latter only produces output when the condition evaluates to false. Why should the default be to always log? For someone trying to understand how a test works or debug a failing test, the extra output is very helpful in understanding control flow.
    6868* Log runtime states sparingly, and only those that may help to diagnose a failing test. Logging runtime states can make tests more self-documenting at the expense of reducing robustness. For example, if a test logs source code locations, these could change (and cause the test to fail) if text is added to or removed from relevant file. It is better to assert actual output against known-good outputs. Don't dump runtime state that is machine-dependent.
     69
     70== Assertion Matchers
     71{{{
     72InspectorTest.expectThat
     73InspectorTest.expectFalse
     74InspectorTest.expectNull
     75InspectorTest.expectNotNull
     76InspectorTest.expectEqual
     77InspectorTest.expectNotEqual
     78InspectorTest.expectShallowEqual
     79InspectorTest.expectNotShallowEqual
     80InspectorTest.expectEqualWithAccuracy
     81InspectorTest.expectLessThan
     82InspectorTest.expectLessThanOrEqual
     83InspectorTest.expectGreaterThan
     84InspectorTest.expectGreaterThanOrEqual
     85}}}
    6986
    7087== Important Test Fixtures