Skip to content

Commit

Permalink
Deprecated ShallowRenderer in favor of TestRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Aug 24, 2021
1 parent 69f04b1 commit c11989e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/src/main/scala/scommons/react/test/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package scommons.react

package object test {

@deprecated("Will be removed soon, use TestInstance instead", "0.5.1")
type ShallowInstance = test.raw.ShallowInstance

@deprecated("Will be removed soon, use TestRendererUtils instead", "0.5.1")
type ShallowRendererUtils = test.util.ShallowRendererUtils

lazy val TestRenderer = test.raw.TestRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import scala.scalajs.js.annotation.JSImport
*/
@JSImport("react-test-renderer/shallow", JSImport.Default)
@js.native
@deprecated("Will be removed soon, use TestRenderer instead", "0.5.1")
class ShallowRenderer extends js.Object {

/**
Expand All @@ -32,6 +33,7 @@ class ShallowRenderer extends js.Object {
}

@js.native
@deprecated("Will be removed soon, use TestInstance instead", "0.5.1")
trait ShallowInstance extends RenderedInstance {

val key: js.Any = js.native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ object RendererUtils {

import scommons.react.test.raw.{ShallowInstance, TestInstance}

@deprecated("Will be removed soon, use testInstanceUtils instead", "0.5.1")
val shallowInstanceUtils: RendererUtils[ShallowInstance] = new RendererUtils[ShallowInstance] {

override def assertNativeComponent(result: ShallowInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import scommons.react.UiComponent
import scommons.react.test.raw.{ShallowInstance, ShallowRenderer}
import scommons.react.test.util.RendererUtils.{shallowInstanceUtils => utils}

@deprecated("Will be removed soon, use TestRendererUtils instead", "0.5.1")
trait ShallowRendererUtils {

def createRenderer(): ShallowRenderer = new ShallowRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package scommons.react.test.raw
import scommons.react._
import scommons.react.test.TestSpec

@deprecated("Will be removed soon, use TestRenderer", "0.5.1")
class ShallowRendererSpec extends TestSpec {

it should "test ShallowRenderer" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import scommons.react._
import scommons.react.test.raw.ShallowInstance
import scommons.react.test.util.RendererUtilsSpec._

@deprecated("Will be removed soon, use TestRendererUtils", "0.5.1")
class ShallowRendererUtilsSpec extends RendererUtilsSpec[ShallowInstance]
with ShallowRendererUtils {

Expand Down

0 comments on commit c11989e

Please sign in to comment.