After reading the documentation about metamask (https://github.com/trufflesuite/trufflesuite.com/blob/master/src/docs/truffle/getting-started/truffle-with-metamask.md) is not clear to me whether it's possible to reuse Truffle functional JS test code in final web apps.

I'm developing a "full-journey" truffle test code around my contracts simulating all use-cases of data from (web)clients to deployed contracts.

Since both the Truffle tests and the final web app are using Javascript and similar libraries (It's this claim true?) intuitively it must be possible to organize truffle-(functional)-test code to (somehow) be reused by the final Web client application saving lot of time.

Has anyone any experience with this topic or best-pattern to create "reusable" test-code?

Edit: Looks like adding "npm install truffle-contract" to the client libraries is "mostly" all that needed. Then it will be a matter of parameterize the tests avoiding hard-coded values. Is that correct?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.