survivejs / react-component-boilerplate

Boilerplate for React.js components (MIT)
https://survivejs.github.io/react-component-boilerplate/
MIT License
359 stars 68 forks source link

`npm test` does not work for a fresh checkout #17

Closed bvaughn closed 9 years ago

bvaughn commented 9 years ago

First off, thank you for creating such a useful template project. It is exactly what I was looking for (and had begun to painfully create for myself).

I'm having trouble actually running tests though. Steps to reproduce:

  1. Clone this repo
  2. Run npm i to install dependencies
  3. Open tests/boilerplate_test.js and uncomment the 3rd line (or add any import statement):
import React from 'react';
  1. Run npm test or npm run tdd

The following error occurs:

$ npm run test

> react-component-boilerplate@1.0.1 test /Users/brianvaughn/Documents/git/react-component-boilerplate
> karma start

Hash: 8344a6c0a9b3c44a5636
Version: webpack 1.12.2
Time: 18ms

ERROR in ./tests/boilerplate_test.js
Module parse failed: /Users/brianvaughn/Documents/git/react-component-boilerplate/tests/boilerplate_test.js Line 3: Unexpected token
You may need an appropriate loader to handle this file type.
| 'use strict';
| 
| import React from 'react';
| // import {
| //   renderIntoDocument,
bebraw commented 9 years ago

@bvaughn Thanks for letting me know! I made the changes needed.

Let me know if you have any further ideas. The current version is starting to feel a little bloated and it will only get worse once I get to integrate Babel 6 (waiting for a dependency). Perhaps it would be a good time to start splitting it up into smaller libraries to consume?

bvaughn commented 9 years ago

Wow, thanks for such a quick fix! Just patched it into my local fork and it works like a charm. :)

I'm still learning the ropes with Webpack to be honest, so I don't have a great suggestion at the moment. This project was exactly what I was looking for- give or take a few linting style issues. :)

bebraw commented 9 years ago

Cool. This is more or less the setup you end with by following my book. That goes into detail and helps you understand what's going on better. So feel to skip through it. :+1: