GoldensConfig class abstract

{@template goldens_config} The configuration for golden tests.

This contains various settings used by goldenTest to determine whether and how to run golden tests.

{@template goldens_config_enabled} The enabled flag determines whether or not these golden tests are enabled. If set to false, these tests will not be generated or compared. Otherwise the tests will function as normal. {@endtemplate goldens_config_enabled}

{@template goldens_config_file_path_resolver} The filePathResolver can be used to customize the name and of the golden file. {@endtemplate goldens_config_file_path_resolver}

{@template goldens_config_theme} If a theme is provided, it will be assigned to the MaterialApp created by Alchemist that wraps the golden test groups and scenarios when a test of this type is run. If no theme is provided, the enclosing AlchemistConfig's theme will be used. If that is also null, the default ThemeData.light will be used.

Note: when obscureText is true, tests are always rendered in the "Ahem" font family to ensure consistent results across platforms. In other words, the font family of the theme will be ignored. {@endtemplate goldens_config_theme}

{@template goldens_config_render_shadows} The renderShadows flag determines whether or not shadows are rendered in golden tests. If set to false, all shadows are replaced with solid color blocks. {@endtemplate goldens_config_render_shadows} {@endtemplate goldens_config}

Implementers

Constructors

GoldensConfig({required bool enabled, required bool obscureText, required bool renderShadows, FilePathResolver? filePathResolver, ThemeData? theme})
const

Properties

enabled bool
Whether or not the golden tests should run.
final
environmentName String
A name for the environment in which this test is run
no setter
filePathResolver FilePathResolver
A function that returns the path of the golden file for a given test's file name. This function's return value should include the .png extension.
no setter
hashCode int
The hash code for this object.
no setterinherited
obscureText bool
Whether or not all text should be rendered as colored boxes
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
renderShadows bool
Whether shadows should be rendered normally or as solid color blocks.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
theme ThemeData?
The ThemeData to use when generating golden tests.
no setter

Methods

copyWith({bool? enabled, bool? obscureText, bool? renderShadows, FilePathResolver? filePathResolver, ThemeData? theme}) GoldensConfig
Creates a copy of this GoldensConfig and replaces the given fields.
merge(covariant GoldensConfig? other) GoldensConfig
Creates a copy and merges this GoldensConfig with the given config, replacing all set fields of the copy with the given config's fields.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited