This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import axios from 'axios'; | |
import './App.css'; | |
const SWAPI_URL = 'https://swapi.co/api'; | |
const FilmSelector = ({ options, onChange }) => ( | |
<select onChange={onChange}> | |
<option value="">Select</option> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { shallow } from 'enzyme' | |
import App from './App' | |
describe('App', () => { | |
it('renders without crashing', () => { | |
const wrapper = shallow(<App />); | |
expect(wrapper).toBeTruthy(); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var enzyme = require('enzyme'); | |
var Adapter = require('enzyme-adapter-react-16'); | |
enzyme.configure({ adapter: new Adapter() }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"roots": [ | |
"<rootDir>/src" | |
], | |
"transform": { | |
"^.+\\.tsx?$": "ts-jest" | |
}, | |
"setupFilesAfterEnv": ["<rootDir>/setupEnzyme.js"], | |
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"], | |
"moduleNameMapper": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module '*.css' | |
declare module '*.scss' | |
declare module '*.html' | |
declare module '*.png' | |
declare module '*.jpg' | |
declare module '*.svg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import './App.scss' | |
const App:React.StatelessComponent<{}> = () => ( | |
<div className='container'> | |
<h1>Hello World, React!</h1> | |
</div> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
{ | |
test: /\.tsx?$/, | |
use: 'ts-loader', | |
exclude: /node_modules/ | |
}, | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist/", | |
"sourceMap": true, | |
"noImplicitAny": true, | |
"module": "commonjs", | |
"target": "es6", | |
"jsx": "react", | |
"allowSyntheticDefaultImports": true, | |
"esModuleInterop": true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
{ | |
test: /\.(png|svg|jpg|gif)$/, | |
use: [ | |
'file-loader' | |
] | |
} | |
... |
NewerOlder