Skip to content

Commit

Permalink
fix: optimize addSerializer in setupJestGlobals (#14554)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha authored Sep 20, 2023
1 parent c9767a9 commit b4c9587
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/jest-jasmine2/src/setup_jest_globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export default async function setupJestGlobals({
}: SetupOptions): Promise<SnapshotState> {
// Jest tests snapshotSerializers in order preceding built-in serializers.
// Therefore, add in reverse because the last added is the first tested.
for (const path of config.snapshotSerializers.concat().reverse()) {
addSerializer(localRequire(path));
for (let i = config.snapshotSerializers.length - 1; i >= 0; i--) {
addSerializer(localRequire(config.snapshotSerializers[i]));
}

patchJasmine();
Expand Down

0 comments on commit b4c9587

Please sign in to comment.