Options
Options can be specified in one of 3 ways:
- An argument passed to your test process, e.g.
--skipTypesor--benchPercentThreshold 10 - An environment variable with an
ATTEST_prefix, e.g.ATTEST_skipTypes=1orATTEST_benchPercentThreshold=10 - Passed as an option to attest's
setupfunction, e.g.:
Here are the current defaults for all available options. Please note, some of these are experimental and subject to change:
skipTypes
skipTypes is extremely useful for iterating quickly during development without having to typecheck your project to test runtime logic.
When this setting is enabled, setup will skip type checking and all assertions requiring type information will be skipped.
You likely want two scripts, one for running tests with types and one for tests without:
Our recommendation is to use test when:
- Only wanting to test runtime logic during development
- Running tests in watch mode or via VSCode's Test Explorer
Use testWithTypes when:
- You've made changes to your types and want to recheck your type-level assertions
- You're running your tests in CI
typeToStringFormat
A set of prettier.Options overrides that apply specifically type.toString formatting.
Any options you provide will override the defaults, which are as follows:
The easiest way to provide overrides is to the setup function, but they can also be provided as a JSON serialized string either passed to a --typeToStringFormat CLI flag or set as the value of ATTEST_typeToStringFormat on process.env.