Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Unify our approach to testing contracts #162

@geoknee

Description

@geoknee

@andrewgordstewart and I investigated some problems I was having in ttt with flickering tests.

The following pattern:

expect(validTransition(postFundSetupB, propose)).toBeTruthy();

can sometimes (often?) result in a promise being checked for truthy-ness, meaning that test will pass regardless of what the promise might resolve to. I fixed it in ttt:

expect(await validTransition(playing1, playing2)).toBe(true);

but something similar needs to be done in wallet and rps.

Furthermore, there is scope for folding this pattern as well as this one

await expect(tttContract.validTransition(encode(againMS), encode(againMF))).rejects.toThrowError("Could not match to a valid transition.");
, into a helper function in magmo-devtools which is the imported into the apps.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions