Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 10 additions & 24 deletions library/busted.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,24 @@ assert = require("luassert")
spy = require("luassert.spy")
stub = require("luassert.stub")
mock = require("luassert.mock")
match = require("luassert.match")

---Undocumented feature with unknown purpose.
---@param filename string
function file(filename) end

---Mark a test as placeholder.
---Mark a test as pending (placeholder).
---
---This will not fail or pass, it will simply be marked as "pending".
---@param name string
---@param block fun()
function pending(name, block) end

---Define the start of an asynchronous test.
---
---Call `done()` at the end of your test to complete it.
---When called as a statement inside a test, marks the current test as pending.
---When called as a block descriptor, registers a pending test node.
---
---## Example
---```
---it("Makes an http request", function()
--- async()
--- http.get("https://github.com", function()
--- print("Got Website!")
--- done()
--- end)
---end)
---```
function async() end
---This will not fail or pass, it will simply be marked as "pending".
---@param name? string
function pending(name) end

---Mark the end of an asynchronous test.
---
---Should be paired with a call to `async()`.
function done() end
---Immediately fail the current test with a message.
---@param message string
function fail(message) end

---Used to define a set of tests. Can be nested to define sub-tests.
---
Expand Down