diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b1d88a6a8d..c3614b98bac4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ### Features +- `[jest-cli]` Adds an option (`inlineSnapshotFormatter` with `simple`) for having inline snapshot serializers use the printBasicPrototype option to show literals as literals. ([#11654](https://github.com/facebook/jest/pull/11654)) + + ### Fixes ### Chore & Maintenance diff --git a/packages/jest-snapshot/src/State.ts b/packages/jest-snapshot/src/State.ts index 62febf9c13f0..1072491e828d 100644 --- a/packages/jest-snapshot/src/State.ts +++ b/packages/jest-snapshot/src/State.ts @@ -204,10 +204,11 @@ export default class SnapshotState { this._uncheckedKeys.delete(key); } + // There is an option to allow for not showing 'Object' and 'Array' on + // snapshots, which we'd like to allow for opting into with inline snapshots. const hasOptedInToSimpleInline = isInline && this._preferSimpleInlineSnapshots; - debugger; - console.log({hasOptedInToSimpleInline, isInline}); + const receivedSerialized = addExtraLineBreaks( serialize(received, undefined, hasOptedInToSimpleInline), );