From e545e42331be6c7161cdfab7cb929173e46e925d Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 9 Jul 2019 14:52:56 +0200 Subject: [PATCH 01/12] add a reproduction to my issue --- .../__tests__/__snapshots__/fails.test.js.snap | 3 +++ .../__tests__/__snapshots__/fails2.test.js.snap | 3 +++ .../__tests__/__snapshots__/works.test.js.snap | 3 +++ e2e/snapshot-unknown/__tests__/works.test.js | 14 ++++++++++++++ e2e/snapshot-unknown/package.json | 5 +++++ 5 files changed, 28 insertions(+) create mode 100644 e2e/snapshot-unknown/__tests__/__snapshots__/fails.test.js.snap create mode 100644 e2e/snapshot-unknown/__tests__/__snapshots__/fails2.test.js.snap create mode 100644 e2e/snapshot-unknown/__tests__/__snapshots__/works.test.js.snap create mode 100644 e2e/snapshot-unknown/__tests__/works.test.js create mode 100644 e2e/snapshot-unknown/package.json diff --git a/e2e/snapshot-unknown/__tests__/__snapshots__/fails.test.js.snap b/e2e/snapshot-unknown/__tests__/__snapshots__/fails.test.js.snap new file mode 100644 index 000000000000..2c4c1a181285 --- /dev/null +++ b/e2e/snapshot-unknown/__tests__/__snapshots__/fails.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snapshot this one makes not toMatchSnapshot assertion, but has a .snap file 1`] = `"normal"`; diff --git a/e2e/snapshot-unknown/__tests__/__snapshots__/fails2.test.js.snap b/e2e/snapshot-unknown/__tests__/__snapshots__/fails2.test.js.snap new file mode 100644 index 000000000000..2c4c1a181285 --- /dev/null +++ b/e2e/snapshot-unknown/__tests__/__snapshots__/fails2.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snapshot this one makes not toMatchSnapshot assertion, but has a .snap file 1`] = `"normal"`; diff --git a/e2e/snapshot-unknown/__tests__/__snapshots__/works.test.js.snap b/e2e/snapshot-unknown/__tests__/__snapshots__/works.test.js.snap new file mode 100644 index 000000000000..2a8b56674496 --- /dev/null +++ b/e2e/snapshot-unknown/__tests__/__snapshots__/works.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snapshot some snapshots exists and are fine 1`] = `"normal"`; diff --git a/e2e/snapshot-unknown/__tests__/works.test.js b/e2e/snapshot-unknown/__tests__/works.test.js new file mode 100644 index 000000000000..a02cba20cbef --- /dev/null +++ b/e2e/snapshot-unknown/__tests__/works.test.js @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +'use strict'; + +describe('snapshot', () => { + it('some snapshots exists and are fine', () => { + expect('normal').toMatchSnapshot(); + }); +}); diff --git a/e2e/snapshot-unknown/package.json b/e2e/snapshot-unknown/package.json new file mode 100644 index 000000000000..148788b25446 --- /dev/null +++ b/e2e/snapshot-unknown/package.json @@ -0,0 +1,5 @@ +{ + "jest": { + "testEnvironment": "node" + } +} From bdee8ed86251f57feaf029f22c078239b09b5468 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 9 Jul 2019 16:24:44 +0200 Subject: [PATCH 02/12] ADD filesRemovedList property to snapshotSummary & display this in the CLI report --- packages/jest-core/src/TestScheduler.ts | 3 ++ .../src/get_snapshot_summary.ts | 8 +++++ packages/jest-snapshot/src/index.ts | 33 +++++++++++++------ packages/jest-test-result/src/helpers.ts | 1 + packages/jest-test-result/src/types.ts | 1 + 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index ff29bde939b2..d29a5c4c038d 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -148,6 +148,9 @@ export default class TestScheduler { ); aggregatedResults.snapshot.filesRemoved += status.filesRemoved; + aggregatedResults.snapshot.filesRemovedList = [ + ...(aggregatedResults.snapshot.filesRemovedList || []), + ].concat(status.filesRemovedList); }); const updateAll = this._globalConfig.updateSnapshot === 'all'; aggregatedResults.snapshot.didUpdate = updateAll; diff --git a/packages/jest-reporters/src/get_snapshot_summary.ts b/packages/jest-reporters/src/get_snapshot_summary.ts index 902cb79b7034..26bb44587364 100644 --- a/packages/jest-reporters/src/get_snapshot_summary.ts +++ b/packages/jest-reporters/src/get_snapshot_summary.ts @@ -84,6 +84,14 @@ export default ( ); } } + if (snapshots.filesRemovedList.length) { + const [head, ...tail] = snapshots.filesRemovedList; + summary.push(` ${DOWN_ARROW} ${DOT}${formatTestPath(globalConfig, head)}`); + + tail.forEach(key => { + summary.push(` ${DOT}${formatTestPath(globalConfig, key)}`); + }); + } if (snapshots.unchecked) { if (snapshots.didUpdate) { diff --git a/packages/jest-snapshot/src/index.ts b/packages/jest-snapshot/src/index.ts index dd9978d1acb5..a4710a488f0a 100644 --- a/packages/jest-snapshot/src/index.ts +++ b/packages/jest-snapshot/src/index.ts @@ -122,22 +122,35 @@ const cleanup = ( hasteFS: HasteFS, update: Config.SnapshotUpdateState, snapshotResolver: JestSnapshotResolver, -) => { +): { + filesRemoved: number; + filesRemovedList: Array; +} => { const pattern = '\\.' + EXTENSION + '$'; const files = hasteFS.matchFiles(pattern); - const filesRemoved = files.reduce((acc, snapshotFile) => { - if (!fileExists(snapshotResolver.resolveTestPath(snapshotFile), hasteFS)) { - if (update === 'all') { - fs.unlinkSync(snapshotFile); + const {count, list} = files.reduce( + (acc: {count: number; list: Array}, snapshotFile) => { + if ( + !fileExists(snapshotResolver.resolveTestPath(snapshotFile), hasteFS) + ) { + if (update === 'all') { + fs.unlinkSync(snapshotFile); + } + return { + ...acc, + count: acc.count + 1, + list: [...acc.list, snapshotFile], + }; } - return acc + 1; - } - return acc; - }, 0); + return acc; + }, + {count: 0, list: []}, + ); return { - filesRemoved, + filesRemoved: count, + filesRemovedList: list, }; }; diff --git a/packages/jest-test-result/src/helpers.ts b/packages/jest-test-result/src/helpers.ts index 202cd2bf6e8c..6020142861bc 100644 --- a/packages/jest-test-result/src/helpers.ts +++ b/packages/jest-test-result/src/helpers.ts @@ -27,6 +27,7 @@ export const makeEmptyAggregatedTestResult = (): AggregatedResult => ({ filesAdded: 0, // combines individual test results + removed files after the full run filesRemoved: 0, + filesRemovedList: [], filesUnmatched: 0, filesUpdated: 0, matched: 0, diff --git a/packages/jest-test-result/src/types.ts b/packages/jest-test-result/src/types.ts index e9acdc40fc86..a9427cd7abb2 100644 --- a/packages/jest-test-result/src/types.ts +++ b/packages/jest-test-result/src/types.ts @@ -181,6 +181,7 @@ export type SnapshotSummary = { failure: boolean; filesAdded: number; filesRemoved: number; + filesRemovedList: Array; filesUnmatched: number; filesUpdated: number; matched: number; From e4857dc973ada9e10fe5552e37cbc8706dde6fdd Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 9 Jul 2019 16:45:12 +0200 Subject: [PATCH 03/12] ADD tests --- e2e/__tests__/snapshot-unknown.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 e2e/__tests__/snapshot-unknown.test.ts diff --git a/e2e/__tests__/snapshot-unknown.test.ts b/e2e/__tests__/snapshot-unknown.test.ts new file mode 100644 index 000000000000..b1697cae7077 --- /dev/null +++ b/e2e/__tests__/snapshot-unknown.test.ts @@ -0,0 +1,20 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import runJest from '../runJest'; + +describe('Snapshot serializers', () => { + it('renders snapshot', () => { + const result = runJest('snapshot-unknown', ['-w=1']); + const stderr = result.stderr; + + expect(stderr).toMatch('2 snapshot files obsolete'); + expect(stderr).toMatch('__tests__/__snapshots__/fails.test.js.snap'); + expect(stderr).toMatch('__tests__/__snapshots__/fails2.test.js.snap'); + expect(result.status).toBe(1); + }); +}); From b68015116750c3359679ca034f5df9bd04d935fb Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 9 Jul 2019 17:03:48 +0200 Subject: [PATCH 04/12] ADD to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c57e8fc17c7..7de7154e51c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Features +- `[jest-cli]` Improve report when snapshots are obsolete ([#8448](https://github.com/facebook/jest/pull/8665)) - `[expect]` Highlight substring differences when matcher fails, part 1 ([#8448](https://github.com/facebook/jest/pull/8448)) - `[expect]` Highlight substring differences when matcher fails, part 2 ([#8528](https://github.com/facebook/jest/pull/8528)) - `[expect]` Improve report when mock-spy matcher fails, part 1 ([#8640](https://github.com/facebook/jest/pull/8640)) From 3a450de69f5d6888c8cc5a12fad712b0cf990346 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 9 Jul 2019 17:34:58 +0200 Subject: [PATCH 05/12] FIX unit tests & add a null-check before getting the array length of new property filesRemovedList --- .../jest-reporters/src/__tests__/get_snapshot_summary.test.js | 4 ++++ .../jest-reporters/src/__tests__/summary_reporter.test.js | 3 +++ packages/jest-reporters/src/get_snapshot_summary.ts | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jest-reporters/src/__tests__/get_snapshot_summary.test.js b/packages/jest-reporters/src/__tests__/get_snapshot_summary.test.js index c2a911d22365..fb76b156b1e2 100644 --- a/packages/jest-reporters/src/__tests__/get_snapshot_summary.test.js +++ b/packages/jest-reporters/src/__tests__/get_snapshot_summary.test.js @@ -21,6 +21,7 @@ test('creates a snapshot summary', () => { didUpdate: false, filesAdded: 1, filesRemoved: 1, + filesRemovedList: [], filesUnmatched: 1, filesUpdated: 1, matched: 2, @@ -49,6 +50,7 @@ test('creates a snapshot summary after an update', () => { didUpdate: true, filesAdded: 1, filesRemoved: 1, + filesRemovedList: [], filesUnmatched: 1, filesUpdated: 1, unchecked: 1, @@ -75,6 +77,7 @@ it('creates a snapshot summary with multiple snapshot being written/updated', () didUpdate: false, filesAdded: 2, filesRemoved: 2, + filesRemovedList: [], filesUnmatched: 2, filesUpdated: 2, unchecked: 2, @@ -105,6 +108,7 @@ it('returns nothing if there are no updates', () => { didUpdate: false, filesAdded: 0, filesRemoved: 0, + filesRemovedList: [], filesUnmatched: 0, filesUpdated: 0, unchecked: 0, diff --git a/packages/jest-reporters/src/__tests__/summary_reporter.test.js b/packages/jest-reporters/src/__tests__/summary_reporter.test.js index b4b56758a6c7..ead47477fc61 100644 --- a/packages/jest-reporters/src/__tests__/summary_reporter.test.js +++ b/packages/jest-reporters/src/__tests__/summary_reporter.test.js @@ -70,6 +70,7 @@ test('snapshots needs update with yarn test', () => { numTotalTestSuites: 1, numTotalTests: 1, snapshot: { + filesRemovedList: [], filesUnmatched: 1, total: 2, uncheckedKeysByFile: [], @@ -98,6 +99,7 @@ test('snapshots all have results (no update)', () => { didUpdate: false, filesAdded: 1, filesRemoved: 1, + filesRemovedList: [], filesUnmatched: 1, filesUpdated: 1, matched: 2, @@ -134,6 +136,7 @@ test('snapshots all have results (after update)', () => { didUpdate: true, filesAdded: 1, filesRemoved: 1, + filesRemovedList: [], filesUnmatched: 1, filesUpdated: 1, matched: 2, diff --git a/packages/jest-reporters/src/get_snapshot_summary.ts b/packages/jest-reporters/src/get_snapshot_summary.ts index 26bb44587364..214963b0edf4 100644 --- a/packages/jest-reporters/src/get_snapshot_summary.ts +++ b/packages/jest-reporters/src/get_snapshot_summary.ts @@ -84,7 +84,7 @@ export default ( ); } } - if (snapshots.filesRemovedList.length) { + if (snapshots.filesRemovedList && snapshots.filesRemovedList.length) { const [head, ...tail] = snapshots.filesRemovedList; summary.push(` ${DOWN_ARROW} ${DOT}${formatTestPath(globalConfig, head)}`); From d2ff007f38046d74cf51e2302908ea42d74933ca Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 9 Jul 2019 22:21:08 +0200 Subject: [PATCH 06/12] chore: run with default reporter to debug ci --- jest.config.ci.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.ci.js b/jest.config.ci.js index 9c4d3a3e706a..04422d74f153 100644 --- a/jest.config.ci.js +++ b/jest.config.ci.js @@ -7,6 +7,6 @@ module.exports = Object.assign({}, require('./jest.config'), { coverageReporters: ['json'], reporters: [ ['jest-junit', {output: 'reports/junit/js-test-results.xml'}], - ['jest-silent-reporter', {useDots: true}], + 'default', ], }); From 895a8d86113b7b0f21bed3c4be9a4b600b513637 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 10 Jul 2019 11:11:52 +0200 Subject: [PATCH 07/12] simplify cleanup function of jest-snapshot --- packages/jest-snapshot/src/index.ts | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/packages/jest-snapshot/src/index.ts b/packages/jest-snapshot/src/index.ts index a4710a488f0a..39a28ae4707a 100644 --- a/packages/jest-snapshot/src/index.ts +++ b/packages/jest-snapshot/src/index.ts @@ -128,28 +128,19 @@ const cleanup = ( } => { const pattern = '\\.' + EXTENSION + '$'; const files = hasteFS.matchFiles(pattern); - const {count, list} = files.reduce( - (acc: {count: number; list: Array}, snapshotFile) => { - if ( - !fileExists(snapshotResolver.resolveTestPath(snapshotFile), hasteFS) - ) { - if (update === 'all') { - fs.unlinkSync(snapshotFile); - } - return { - ...acc, - count: acc.count + 1, - list: [...acc.list, snapshotFile], - }; + const list = files.reduce>((acc, snapshotFile) => { + if (!fileExists(snapshotResolver.resolveTestPath(snapshotFile), hasteFS)) { + if (update === 'all') { + fs.unlinkSync(snapshotFile); } + return [...acc, snapshotFile]; + } - return acc; - }, - {count: 0, list: []}, - ); + return acc; + }, []); return { - filesRemoved: count, + filesRemoved: list.length, filesRemovedList: list, }; }; From 3360711c66c7b31b1e2abc0ddb90a47d069cdcc5 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 26 Jul 2019 11:16:01 +0200 Subject: [PATCH 08/12] chore: use filter over reduce --- packages/jest-snapshot/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/jest-snapshot/src/index.ts b/packages/jest-snapshot/src/index.ts index 39a28ae4707a..bb0c050105b2 100644 --- a/packages/jest-snapshot/src/index.ts +++ b/packages/jest-snapshot/src/index.ts @@ -128,16 +128,16 @@ const cleanup = ( } => { const pattern = '\\.' + EXTENSION + '$'; const files = hasteFS.matchFiles(pattern); - const list = files.reduce>((acc, snapshotFile) => { + const list = files.filter(snapshotFile => { if (!fileExists(snapshotResolver.resolveTestPath(snapshotFile), hasteFS)) { if (update === 'all') { fs.unlinkSync(snapshotFile); } - return [...acc, snapshotFile]; + return true; } - return acc; - }, []); + return false; + }); return { filesRemoved: list.length, From 54278546806d91ebb9270cd84d1cb50d811cc7b0 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 26 Jul 2019 11:22:55 +0200 Subject: [PATCH 09/12] chore: only report obsolete snapshots of non-ignored tests --- packages/jest-core/src/TestScheduler.ts | 1 + packages/jest-snapshot/src/index.ts | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index d29a5c4c038d..2662e7b231e7 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -145,6 +145,7 @@ export default class TestScheduler { context.hasteFS, this._globalConfig.updateSnapshot, snapshot.buildSnapshotResolver(context.config), + context.config.testPathIgnorePatterns, ); aggregatedResults.snapshot.filesRemoved += status.filesRemoved; diff --git a/packages/jest-snapshot/src/index.ts b/packages/jest-snapshot/src/index.ts index bb0c050105b2..a6de3a1a9ddd 100644 --- a/packages/jest-snapshot/src/index.ts +++ b/packages/jest-snapshot/src/index.ts @@ -122,14 +122,27 @@ const cleanup = ( hasteFS: HasteFS, update: Config.SnapshotUpdateState, snapshotResolver: JestSnapshotResolver, + testPathIgnorePatterns?: Config.ProjectConfig['testPathIgnorePatterns'], ): { filesRemoved: number; filesRemovedList: Array; } => { const pattern = '\\.' + EXTENSION + '$'; const files = hasteFS.matchFiles(pattern); + let testIgnorePatternsRegex: RegExp | null = null; + if (testPathIgnorePatterns && testPathIgnorePatterns.length > 0) { + testIgnorePatternsRegex = new RegExp(testPathIgnorePatterns.join('|')); + } + const list = files.filter(snapshotFile => { - if (!fileExists(snapshotResolver.resolveTestPath(snapshotFile), hasteFS)) { + const testPath = snapshotResolver.resolveTestPath(snapshotFile); + + // ignore snapshots of ignored tests + if (testIgnorePatternsRegex && testIgnorePatternsRegex.test(testPath)) { + return false; + } + + if (!fileExists(testPath, hasteFS)) { if (update === 'all') { fs.unlinkSync(snapshotFile); } From d25b005986d7fb5dd56e961e02a55b9acfdba440 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 26 Jul 2019 11:23:57 +0200 Subject: [PATCH 10/12] Revert "chore: run with default reporter to debug ci" This reverts commit d2ff007f38046d74cf51e2302908ea42d74933ca. --- jest.config.ci.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.ci.js b/jest.config.ci.js index 04422d74f153..9c4d3a3e706a 100644 --- a/jest.config.ci.js +++ b/jest.config.ci.js @@ -7,6 +7,6 @@ module.exports = Object.assign({}, require('./jest.config'), { coverageReporters: ['json'], reporters: [ ['jest-junit', {output: 'reports/junit/js-test-results.xml'}], - 'default', + ['jest-silent-reporter', {useDots: true}], ], }); From 1cde9a31b39a7bb4cae0bda42e80ec9374aec4e2 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 26 Jul 2019 12:39:19 +0200 Subject: [PATCH 11/12] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cd3789fc975..52487eeaf581 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ ### Features -- `[jest-cli]` Improve report when snapshots are obsolete ([#8448](https://github.com/facebook/jest/pull/8665)) - `[expect]` Highlight substring differences when matcher fails, part 1 ([#8448](https://github.com/facebook/jest/pull/8448)) - `[expect]` Highlight substring differences when matcher fails, part 2 ([#8528](https://github.com/facebook/jest/pull/8528)) - `[expect]` Improve report when mock-spy matcher fails, part 1 ([#8640](https://github.com/facebook/jest/pull/8640)) @@ -11,6 +10,7 @@ - `[expect]` Improve report when mock-spy matcher fails, part 4 ([#8710](https://github.com/facebook/jest/pull/8710)) - `[expect]` Throw matcher error when received cannot be jasmine spy ([#8747](https://github.com/facebook/jest/pull/8747)) - `[jest-snapshot]` Highlight substring differences when matcher fails, part 3 ([#8569](https://github.com/facebook/jest/pull/8569)) +- `[jest-core]` Improve report when snapshots are obsolete ([#8448](https://github.com/facebook/jest/pull/8665)) - `[jest-cli]` Improve chai support (with detailed output, to match jest exceptions) ([#8454](https://github.com/facebook/jest/pull/8454)) - `[*]` Manage the global timeout with `--testTimeout` command line argument. ([#8456](https://github.com/facebook/jest/pull/8456)) - `[pretty-format]` Render custom displayName of memoized components From 930400fa631986b7f51d9b2bac07cb814143d7a3 Mon Sep 17 00:00:00 2001 From: Tim Seckinger Date: Fri, 26 Jul 2019 22:06:00 +0200 Subject: [PATCH 12/12] get rid of unnecessary array spread --- packages/jest-core/src/TestScheduler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index 2662e7b231e7..bce8ca39125d 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -149,9 +149,9 @@ export default class TestScheduler { ); aggregatedResults.snapshot.filesRemoved += status.filesRemoved; - aggregatedResults.snapshot.filesRemovedList = [ - ...(aggregatedResults.snapshot.filesRemovedList || []), - ].concat(status.filesRemovedList); + aggregatedResults.snapshot.filesRemovedList = ( + aggregatedResults.snapshot.filesRemovedList || [] + ).concat(status.filesRemovedList); }); const updateAll = this._globalConfig.updateSnapshot === 'all'; aggregatedResults.snapshot.didUpdate = updateAll;