TypeScript declarations for Busted
This repository contains TypeScript declarations for Busted. An Elegant Lua unit testing framework.
You can install these via npm.
yarn add -D busted-tstl
# or
npm install -D busted-tstl
link them up in your tsconfig.json file.
It is recommended to use lua-types with these declarations as those will tell TypeScript about Lua's environment.
start creating your busted tests within .ts files (preferably with the suffix _spec.ts within a folder named spec).
describe"mocks",;
Then transpile the file(s) with TypeScriptToLua and run busted!
tstl spec/test_spec.tststl -p tsconfig.jsonbusted # Install with `luarocks install busted`
It is recommended to use lua-types with these declarations as those will tell TypeScript about Lua's environment.
Assertion Statement Info
Assertion statements can be built with underscores and/or dots.
assert.is.Truetrue; // Equivalentassert.is_truetrue; // Equivalent assert.is.not.Truefalse; // Equivalentassert.is_not_truefalse; // Equivalent
Verbs can be chained. However if there is a not
or no
within the chain, the assertion is expected to be fail. This cannot be reverted with another not
or no
.
assert.is.is.is.not.is.not.Falsetrue; // Assertion failed. // This was expected because of `not`