aleeusgr / potential-robot

minimal dApp testing suite
MIT License
3 stars 1 forks source link

improve typing. #125

Closed aleeusgr closed 5 months ago

aleeusgr commented 1 year ago

https://www.typescriptlang.org/docs/handbook/interfaces.html

aleeusgr commented 1 year ago

I am thinking that it would be better if there was a more explicit item in test-context that can have its own class, instead of being an extension of the VitestContext (as the Vitest people suggest).

https://discord.com/channels/@me/960928001791512576/1119677503573864458

aleeusgr commented 1 year ago

It would be in the beforeEach for the test.

        beforeEach<localTC>(async (context) => {
        await addTestContext(context, CommunityTreasury, CCTHelpers);
    });

Restructuring it would make the setup syntax simpler.

aleeusgr commented 1 year ago

For instance, any testing context would have actors. Which actors? Depends on the contract and how the developer wants to arrange them.

aleeusgr commented 1 year ago

I think setup() is part of the test-helpers - so not necessarily used in every contract test On the other hand, it's probably a useful part of the base-class and a good convention for any contract test.