I am trying to run tests to test my react components. They were running until I introduced react-router and scss files.
for example when I run npm test
it fails on:
.messageForm {
border: 1px solid black;
width: 250px;
}
saying that the .
is an unexpected token.
another tests fails due to:
return (
<h1 id="channelHeading"> {this.props.route.channel} </h1>
)
saying that it cannot read channel of undefined. i.e route
is undefined. even though it is working fine when I run the code and I have imported it at the top like so:
import { Router, Route, IndexRoute, hashHistory, Link } from 'react-router';
I think I need to either get it to ignore the scss files or tell it to compile it correctly. I am using lots of babel plugins already to convert my code from es6 so that the browser can read it, I'm just struggling to get these tests to run.
Aucun commentaire:
Enregistrer un commentaire