Testing Configuration - Building Secure Contracts (original) (raw)

Building Secure Contracts

Testing Configuration

The testing configuration can be broken down into a few subcomponents:

We will go over each subcomponent one-by-one:

High-level Configuration

stopOnFailedTest

stopOnFailedContractMatching


contract MyContract {
  OtherContract otherContract;
  constructor() {
    // This is a dynamically deployed contract
    otherContract = new otherContract();
  }
}

stopOnNoTests

testViewMethods

testAllContracts

verbosity:

targetFunctionSignatures:

excludeFunctionSignatures:

Assertion Testing Configuration

enabled

panicCodeConfig

failOnAssertion

failOnCompilerInsertedPanic

failOnArithmeticUnderflow

failOnDivideByZero

failOnEnumTypeConversionOutOfBounds

failOnIncorrectStorageAccess

failOnPopEmptyArray

failOnOutOfBoundsArrayAccess

failOnAllocateTooMuchMemory

failOnCallUninitializedVariable

Property Testing Configuration

enabled

testPrefixes

Optimization Testing Configuration

enabled

testPrefixes