Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrimeyer committed Oct 2, 2020
1 parent a92d3f1 commit e140214
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions docs/api-reference.md
Expand Up @@ -147,14 +147,14 @@ afterEach(function()
globalState = DEFAULT_STATE
end)

it("SHOULD read globalState", function()
expect(globalState.hello).to.equal("world")
end)

it("SHOULD insert globalState", function()
globalState.foo = "bar"
expect(globalState.foo).to.equal("bar")
end)

it("SHOULD read globalState", function()
expect(globalState.hello).to.equal("world")
end)
```

#### beforeAll
Expand Down Expand Up @@ -261,6 +261,19 @@ This function works similarly to `FOCUS()`, except instead of marking a block as
!!!note
`SKIP` does not work inside an `it` block. The bodies of these blocks aren't executed until the tests run, which is too late to change which tests will run.

### describeFOCUS and describeSKIP
```
describeFOCUS(phrase: string)
describeSKIP(phrase: string)
```

These methods are special versions of `describe` that automatically mark the `describe` block as *focused* or *skipped*.

!!!note
`fdescribe` is an alias for `describeFOCUS`.
`xdescribe` is an alias for `describeSKIP`.


### itFOCUS, itSKIP, and itFIXME
```
itFOCUS(phrase: string, callback(context: table))
Expand All @@ -270,6 +283,11 @@ itFIXME(phrase: string, callback(context: table))

These methods are special versions of `it` that automatically mark the `it` block as *focused* or *skipped*. They're necessary because `FOCUS`, `SKIP`, and `FIXME` can't be called inside `it` blocks!

!!!note
`fit` is an alias for `itFOCUS`.
`xit` is an alias for `itSKIP`.


## init.spec.lua

When loading a spec file, TestEZ creates a new `describe` block for each file
Expand Down Expand Up @@ -299,6 +317,7 @@ return function()
context.helpers = require(script.Parent.helpers)
end)
end

-- test.spec.lua
return function()
it("a test using a helper", function(context)
Expand Down

0 comments on commit e140214

Please sign in to comment.