dwf: cleaned up code formatting in README
This commit is contained in:
parent
00f5f1722c
commit
f5486bde35
@ -64,9 +64,9 @@ Your spec can call `runs()` multiple times if you need to break your spec up for
|
||||
});
|
||||
|
||||
runs(function () {
|
||||
this.foo++;
|
||||
|
||||
this.expects_that(this.foo).should_equal(2);
|
||||
this.foo++;
|
||||
|
||||
this.expects_that(this.foo).should_equal(2);
|
||||
})
|
||||
});
|
||||
|
||||
@ -82,21 +82,21 @@ Jasmine allows you to do this by chaining calls to `runs()` with calls to `waits
|
||||
|
||||
it('should be a test', function () {
|
||||
runs(function () {
|
||||
this.foo = 0;
|
||||
this.foo = 0;
|
||||
var that = this;
|
||||
setTimeout(function () {}
|
||||
that.foo++;
|
||||
}, 250);
|
||||
});
|
||||
|
||||
runs(function () {
|
||||
this.expects_that(this.foo).should_equal(0);
|
||||
});
|
||||
|
||||
waits(500);
|
||||
|
||||
setTimeout(function () {
|
||||
that.foo++;
|
||||
}, 250);
|
||||
});
|
||||
|
||||
runs(function () {
|
||||
this.expects_that(this.foo).should_equal(1);
|
||||
this.expects_that(this.foo).should_equal(0);
|
||||
});
|
||||
|
||||
waits(500);
|
||||
|
||||
runs(function () {
|
||||
this.expects_that(this.foo).should_equal(1);
|
||||
});
|
||||
});
|
||||
|
||||
@ -111,14 +111,14 @@ What's happening here?
|
||||
|
||||
Specs are grouped in Suites. Suites are defined using the global `describe()` function:
|
||||
|
||||
describe('One suite', function () {
|
||||
it('has a test', function () {
|
||||
...
|
||||
});
|
||||
|
||||
it('has another test', function () {
|
||||
describe('One suite', function () {
|
||||
it('has a test', function () {
|
||||
...
|
||||
});
|
||||
});
|
||||
|
||||
it('has another test', function () {
|
||||
...
|
||||
});
|
||||
});
|
||||
|
||||
The name is so that reporting is more descriptive.
|
||||
|
@ -110,7 +110,7 @@
|
||||
<file leaf-file-name="example.html" pinned="false" current="true" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/example/example.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="18" column="6" selection-start="620" selection-end="620" vertical-scroll-proportion="0.35440415">
|
||||
<state line="8" column="7" selection-start="355" selection-end="355" vertical-scroll-proportion="0.15751295">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
@ -538,7 +538,7 @@
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/example/example.html">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="18" column="6" selection-start="620" selection-end="620" vertical-scroll-proportion="0.35440415">
|
||||
<state line="8" column="7" selection-start="355" selection-end="355" vertical-scroll-proportion="0.15751295">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
|
Loading…
Reference in New Issue
Block a user