class ShallowRenderer extends Object
You can think of the shallowRenderer as a "place" to render the component you're testing, and from which you can extract the component's output.
- Annotations
- @JSType() @JSImport("react-test-renderer/shallow", JSImport.Default) @native() @deprecated
- Deprecated
(Since version 0.5.1) Will be removed soon, use TestRenderer instead
- See also
https://reactjs.org/docs/shallow-renderer.html
- Alphabetic
- By Inheritance
- ShallowRenderer
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ShallowRenderer()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getRenderOutput(): ShallowInstance
After
shallowRenderer.render()
has been called, you can useshallowRenderer.getRenderOutput()
to get the shallowly rendered output.After
shallowRenderer.render()
has been called, you can useshallowRenderer.getRenderOutput()
to get the shallowly rendered output.You can then begin to assert facts about the output.
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- def render(element: io.github.shogowada.scalajs.reactjs.elements.ReactElement): Unit
shallowRenderer.render()
is similar toReactDOM.render()
but it doesn't require DOM and only renders a single level deep.shallowRenderer.render()
is similar toReactDOM.render()
but it doesn't require DOM and only renders a single level deep. This means you can test components isolated from how their children are implemented. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()