Skip to content

Commit

Permalink
prepare lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybotha committed Nov 24, 2018
1 parent eb345a8 commit 9fb135e
Show file tree
Hide file tree
Showing 7 changed files with 6,684 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const isTest = String(process.env.NODE_ENV) === 'test';
const isProd = String(process.env.NODE_ENV) === 'production';

module.exports = {
presets: [
['@babel/preset-env', {modules: isTest ? 'commonjs' : false}],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
].filter(Boolean),
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test React Components with Jest and `react-testing-library`

Checkout individual branches for changes specific to that section of the course.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import ReactDOM from 'react-dom';

import {FavoriteNumber} from '../src/favorite-number';

describe('FavoriteNumber', () => {
test('renders a number input with a label "Favourite Number"', () => {
const div = document.createElement('div');

ReactDOM.render(<FavoriteNumber />, div);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)'],
};
Loading

0 comments on commit 9fb135e

Please sign in to comment.