Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prefer-inline-snapshots.md 1.1KB

Suggest using inline snapshots (prefer-inline-snapshots)

Deprecated

This rule has been deprecated in favor of no-restricted-matchers with the following config:

{
  "rules": {
    "jest/no-restricted-matchers": [
      "error",
      {
        "toThrowErrorMatchingSnapshot": "Use `toThrowErrorMatchingInlineSnapshot()` instead",
        "toMatchSnapshot": "Use `toMatchInlineSnapshot()` instead"
      }
    ]
  }
}

In order to make snapshot tests more manageable and reviewable toMatchInlineSnapshot() and toThrowErrorMatchingInlineSnapshot should be used to write the snapshots’ inline in the test file.

Rule details

This rule triggers a warning if toMatchSnapshot() or toThrowErrorMatchingSnapshot is used to capture a snapshot.

The following pattern is considered warning:

expect(obj).toMatchSnapshot();
expect(error).toThrowErrorMatchingSnapshot();

The following pattern is not warning:

expect(obj).toMatchInlineSnapshot();
expect(error).toThrowErrorMatchingInlineSnapshot();