Commit 96bc6173 authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH
Browse files

fixed testing! instrumentation only shows for files in src/ for some reason

parent ce5d6d6b
......@@ -20,11 +20,11 @@ module.exports = function (config) {
frameworks: ['mocha'],
// this is the entry file for all our tests.
files: [
'./test/index.js'
'./test/index.js',
],
// we will pass the entry file to webpack for bundling.
preprocessors: {
'./test/index.js': [ 'webpack', 'sourcemap' ],
'**/*': [ 'webpack', 'sourcemap' ],
},
reporters: [
'mocha',
......
......@@ -6,8 +6,8 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { AppContainer } from 'react-hot-loader';
import App from './components/App.jsx';
import store from './store';
import App from './src/components/App.jsx';
import store from '@store';
ReactDOM.render(
<AppContainer>
......@@ -20,8 +20,8 @@ ReactDOM.render(
// Hot Module Replacement API
if (module.hot) {
module.hot.accept('./components/App', () => {
const NextApp = require('./components/App').default;
module.hot.accept('./src/components/App', () => {
const NextApp = require('./src/components/App').default;
ReactDOM.render(
<AppContainer>
<Provider store={ store }>
......
......@@ -21,6 +21,10 @@ class Foo extends React.Component<FooProps, FooState> {
);
}
isntCovered = () => {
console.log(`mauahahahahah`);
}
componentDidMount(){}
}
......
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
// require all test files using special Webpack feature
// https://webpack.js.org/guides/dependency-management/#require-context
const testsContext = require.context('.', true, /\.spec.js(x)?$/);
......
// @flow
import React from 'react';
import { expect } from 'chai';
import { configure, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { mount } from 'enzyme';
import sinon from 'sinon';
import Foo from './Foo.jsx';
configure({ adapter: new Adapter() });
import Foo from '../src/Foo.jsx';
describe('<Foo />', () => {
it('calls componentDidMount', () => {
......
......@@ -14,7 +14,7 @@ module.exports = {
main: [
'react-hot-loader/patch',
// all our code starts here
'./src/main.jsx',
'./main.jsx',
]
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment