import React, {Component} from 'react'; import { AppRegistry, StyleSheet, Text, View, Platform, ScrollView, Image, } from 'react-native'; export default class Assert extends Component { props : { expect : any, actual : any, desc : any, compaer : () => bool }; constructor(props) { super(props) } render() { return ( { this.getAssertion() ? '✅' : '×' } {this.props.desc} expect {String(this.props.expect)} actual {String(this.props.actual)} {this.props.comparer ? comparer = { String(this.props.comparer) } : null} ) } getAssertion() { if(this.props.comparer) return this.props.comparer(this.props.expect, this.props.actual) else return this.props.expect === this.props.actual } }