-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to gate Specs Duplicate State Update detection via Compon…
…entsConfiguration Summary: In this diff I do the integration of the gating for the state update detection. Reviewed By: adityasharat Differential Revision: D51073754 fbshipit-source-id: d83aa172d4a30042aa4d8697e9ec82a2a3709b56
- Loading branch information
1 parent
b3ceb97
commit 9b20471
Showing
6 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...main/java/com/facebook/litho/testing/testrunner/SpecsStateUpdateDetectionConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.facebook.litho.testing.testrunner | ||
|
||
import com.facebook.litho.config.ComponentsConfiguration | ||
import org.junit.runners.model.FrameworkMethod | ||
|
||
class SpecsStateUpdateDetectionConfiguration : LithoTestRunConfiguration { | ||
|
||
private val defaultInstance = ComponentsConfiguration.defaultInstance | ||
|
||
override fun beforeTest(method: FrameworkMethod) { | ||
ComponentsConfiguration.defaultInstance = | ||
defaultInstance.copy(specsApiStateUpdateDuplicateDetectionEnabled = true) | ||
} | ||
|
||
override fun afterTest(method: FrameworkMethod) { | ||
ComponentsConfiguration.defaultInstance = defaultInstance | ||
} | ||
} |