Enum SnapshotTestOptions.DiffLineNumbers

    • Enum Constant Detail

      • ACCORDING_TO_RAW_DATA

        public static final SnapshotTestOptions.DiffLineNumbers ACCORDING_TO_RAW_DATA
        No offset will be added to line numbers. Line number 1 in rendered diffs maps directly to line number 1 in the raw serialized test output.

        Note: when using this mode, the line numbers reported in assertion failure message to not match the line numbers in persisted snapshot files.

      • ACCODRDING_TO_PERSISTED_SNAPSHOT_FILE

        public static final SnapshotTestOptions.DiffLineNumbers ACCODRDING_TO_PERSISTED_SNAPSHOT_FILE
        Adds an offset according to the number of snapshot file header lines. Line number 1 in rendered diffs maps to line number 1 in persisted snapshot files. Consequently, real snapshot data starts at 1 + Number of header lines + 1.

        Note: this option might be preferable over ACCORDING_TO_RAW_DATA as line numbers reported in assertion failures directly map to physical lines within the persisted snapshot file.

    • Method Detail

      • values

        public static SnapshotTestOptions.DiffLineNumbers[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SnapshotTestOptions.DiffLineNumbers c : SnapshotTestOptions.DiffLineNumbers.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SnapshotTestOptions.DiffLineNumbers valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null