Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

New assertion library #67

Open
LPGhatguy opened this issue Mar 24, 2020 · 2 comments
Open

New assertion library #67

LPGhatguy opened this issue Mar 24, 2020 · 2 comments

Comments

@LPGhatguy
Copy link
Contributor

We've slowly been becoming less happy about Expectation as our assertion syntax.

It might be a good idea to involve a new assertion library and syntax, like the one from Busted, which is more flexible. Some examples from Busted:

-- deep check comparisons!
assert.are.same({ table = "great"}, { table = "great" })

-- or check by reference!
assert.are_not.equal({ table = "great"}, { table = "great"})

assert.truthy("this is a string") -- truthy: not false or nil

assert.True(1 == 1)
assert.is_true(1 == 1)

assert.falsy(nil)
assert.has_error(function() error("Wat") end, "Wat")
@amoss-roblox
Copy link

I quite like this provided we have better docs than Busted! Jest (https://jestjs.io/docs/en/expect) and jest extended (https://github.com/jest-community/jest-extended) are good.

We should add https://jestjs.io/docs/en/expect#expectextendmatchers so that people can extend Expectation

@amoss-roblox
Copy link

Aha I see #62 has implemented extend

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants