File tree 9 files changed +2198
-39
lines changed
9 files changed +2198
-39
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "presets" : [" @babel/preset-react" , " @babel/typescript" ],
2
+ "presets" : [
3
+ [
4
+ " @babel/env" ,
5
+ {
6
+ "targets" : {
7
+ "browsers" : [" last 2 versions" ]
8
+ }
9
+ }
10
+ ],
11
+ " @babel/typescript" ,
12
+ " @babel/preset-react"
13
+ ],
3
14
"plugins" : [" @babel/proposal-class-properties" , " @babel/proposal-object-rest-spread" ]
4
15
}
Original file line number Diff line number Diff line change
1
+ root = true
2
+
3
+ [* ]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
Original file line number Diff line number Diff line change 9
9
"dev" : " run-p dev:*" ,
10
10
"dev:webpack" : " webpack-dev-server --mode development --content-base ./site" ,
11
11
"dev:ts" : " tsc --watch --preserveWatchOutput" ,
12
- "build" : " yarn run clean && tsc && webpack --mode production"
12
+ "test" : " jest" ,
13
+ "build" : " yarn run clean && tsc && yarn run test && webpack --mode production"
13
14
},
14
15
"devDependencies" : {
15
16
"@babel/core" : " ^7.2.2" ,
16
17
"@babel/plugin-proposal-class-properties" : " ^7.3.0" ,
17
18
"@babel/plugin-proposal-object-rest-spread" : " ^7.3.1" ,
19
+ "@babel/preset-env" : " ^7.3.1" ,
18
20
"@babel/preset-react" : " ^7.0.0" ,
19
21
"@babel/preset-typescript" : " ^7.1.0" ,
22
+ "@types/jest" : " ^23.3.13" ,
20
23
"@types/react" : " ^16.7.22" ,
21
24
"@types/react-dom" : " ^16.0.11" ,
22
25
"babel-loader" : " ^8.0.5" ,
26
+ "jest" : " ^24.0.0" ,
23
27
"npm-run-all" : " ^4.1.5" ,
24
28
"typescript" : " ^3.3.0-rc" ,
25
29
"webpack" : " 5.0.0-alpha.9" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ export const sum = ( x : number , y : number ) => x + y
Original file line number Diff line number Diff line change
1
+ import { sum } from '../Sum'
2
+
3
+ test ( 'adds 1 + 2 to equal 3' , ( ) => {
4
+ expect ( sum ( 1 , 2 ) ) . toBe ( 3 )
5
+ } )
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import ReactDOM from 'react-dom'
3
3
4
- import { add } from 'Foo '
4
+ import { sum } from 'Sum '
5
5
import Example from 'lib/Example'
6
6
7
7
enum Check {
@@ -11,7 +11,7 @@ enum Check {
11
11
12
12
const Foo = ( ) => (
13
13
< div style = { { fontSize : 24 } } >
14
- Hello: { Check . Bar } | { add ( 3 , 2 ) }
14
+ Hello: { Check . Bar } | { sum ( 3 , 2 ) }
15
15
< Example initialCounter = { 2 } />
16
16
</ div >
17
17
)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ interface Props {
7
7
export default function Example ( { initialCounter } : Props ) {
8
8
// Declare a new state variable, which we'll call "count"
9
9
const [ count , setCount ] = useState ( initialCounter )
10
+ console . log ( 'render: ' , count )
10
11
11
12
return (
12
13
< div >
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments