Skip to content

Commit 45bcb2b

Browse files
committed
configures Jest and Enzyme, scaffolds testing suite
1 parent e98bea2 commit 45bcb2b

File tree

11 files changed

+2034
-113
lines changed

11 files changed

+2034
-113
lines changed

demo/Grid1.demo.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ const GridDemo1 = () => (
55
<div id="grid-demo-1">
66
<pre style={{ marginTop: '0px' }}>
77
<code>
8-
hCount: 14
8+
hCount: 14
99
<br />
10-
hGap: 10px
10+
hGap: 10px
1111
<br />
12-
vGap: 10px
12+
vGap: 10px
1313
<br />
1414
{'breakpoints: {'}
1515
<br />
16-
&emsp;s: 576
16+
&emsp;s: 576
1717
<br />
18-
&emsp;m: 768
18+
&emsp;m: 768
1919
<br />
20-
&emsp;l: 992
20+
&emsp;l: 992
2121
<br />
22-
&emsp;xl: 1200
22+
&emsp;xl: 1200
2323
<br />
2424
{'}'}
2525
<br />
26-
scopeCSSTo: #grid-demo-1
26+
scopeCSSTo: #grid-demo-1
2727
</code>
2828
</pre>
2929
<div style={{ position: 'relative' }}>
@@ -75,13 +75,13 @@ const GridDemo1 = () => (
7575
>
7676
<pre>
7777
<code>
78-
hSpan: 4
78+
hSpan: 4
7979
<br />
80-
hSpanL: 12
80+
hSpanL: 12
8181
<br />
82-
hSpanM: 14
82+
hSpanM: 14
8383
<br />
84-
hSpanS: 6
84+
hSpanS: 6
8585
</code>
8686
</pre>
8787
</Cell>
@@ -105,11 +105,11 @@ const GridDemo1 = () => (
105105
>
106106
<pre>
107107
<code>
108-
hSpan: 4
108+
hSpan: 4
109109
<br />
110-
hSpanL: 5
110+
hSpanL: 5
111111
<br />
112-
hStart: 4
112+
hStart: 4
113113
</code>
114114
</pre>
115115
</Cell>
@@ -135,11 +135,11 @@ const GridDemo1 = () => (
135135
>
136136
<pre>
137137
<code>
138-
hSpan: 10
138+
hSpan: 10
139139
<br />
140-
hSpanM: 14
140+
hSpanM: 14
141141
<br />
142-
vStart: 1 (via inline style)
142+
vStart: 1 (via inline style)
143143
</code>
144144
</pre>
145145
</Cell>

demo/Grid2.demo.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ const GridDemo2 = () => (
55
<div id="grid-demo-2">
66
<pre style={{ marginTop: '0px' }}>
77
<code>
8-
hCount: 12
8+
hCount: 12
99
<br />
10-
hGap: columnWidth
10+
hGap: columnWidth
1111
<br />
12-
vGap: 10px
12+
vGap: 10px
1313
<br />
1414
{'breakpoints: {'}
1515
<br />
16-
&emsp;s: 576
16+
&emsp;s: 576
1717
<br />
18-
&emsp;m: 768
18+
&emsp;m: 768
1919
<br />
20-
&emsp;l: 992
20+
&emsp;l: 992
2121
<br />
22-
&emsp;xl: 1200
22+
&emsp;xl: 1200
2323
<br />
2424
{'}'}
2525
<br />
26-
scopeCSSTo: #grid-12-col-demo
26+
scopeCSSTo: #grid-12-col-demo
2727
</code>
2828
</pre>
2929
<div style={{ position: 'relative' }}>
@@ -53,15 +53,15 @@ const GridDemo2 = () => (
5353
>
5454
<pre>
5555
<code>
56-
hSpan: 6
56+
hSpan: 6
5757
<br />
58-
hSpanL: 5
58+
hSpanL: 5
5959
<br />
60-
hSpanM: 4
60+
hSpanM: 4
6161
<br />
62-
hSpanS: 10
62+
hSpanS: 10
6363
<br />
64-
hSpanXS: 12
64+
hSpanXS: 12
6565
</code>
6666
</pre>
6767
</Cell>
@@ -75,15 +75,15 @@ const GridDemo2 = () => (
7575
>
7676
<pre>
7777
<code>
78-
hSpan: 6
78+
hSpan: 6
7979
<br />
80-
hSpanL: 5
80+
hSpanL: 5
8181
<br />
82-
hSpanM: 4
82+
hSpanM: 4
8383
<br />
84-
hSpanS: 10
84+
hSpanS: 10
8585
<br />
86-
hSpanXS: 12
86+
hSpanXS: 12
8787
</code>
8888
</pre>
8989
</Cell>
@@ -103,13 +103,13 @@ const GridDemo2 = () => (
103103
>
104104
<pre>
105105
<code>
106-
hSpan: 2
106+
hSpan: 2
107107
<br />
108-
hSpanM: 3
108+
hSpanM: 3
109109
<br />
110-
hStart: 2
110+
hStart: 2
111111
<br />
112-
hStartS: 11
112+
hStartS: 11
113113
</code>
114114
</pre>
115115
</Cell>

demo/Grid3.demo.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ const GridDemo3 = () => (
55
<div id="grid-demo-3">
66
<pre style={{ marginTop: '0px' }}>
77
<code>
8-
hCount: 8
8+
hCount: 8
99
<br />
10-
hGap: 2vw
10+
hGap: 2vw
1111
<br />
12-
vGap: 1rem
12+
vGap: 1rem
1313
<br />
1414
{'breakpoints: {'}
1515
<br />
16-
&emsp;xs: 375
16+
&emsp;xs: 375
1717
<br />
18-
&emsp;s: 600
18+
&emsp;s: 600
1919
<br />
20-
&emsp;m: 720
20+
&emsp;m: 720
2121
<br />
22-
&emsp;l: 1080
22+
&emsp;l: 1080
2323
<br />
24-
&emsp;xl: 1390
24+
&emsp;xl: 1390
2525
<br />
2626
{'}'}
2727
<br />
28-
scopeCSSTo: #grid-demo-3
28+
scopeCSSTo: #grid-demo-3
2929
<br />
30-
classPrefix: abcde
30+
classPrefix: abcde
3131
</code>
3232
</pre>
3333
<div style={{ position: 'relative' }}>
@@ -75,9 +75,9 @@ const GridDemo3 = () => (
7575
>
7676
<pre>
7777
<code>
78-
hSpan: 4
78+
hSpan: 4
7979
<br />
80-
hSpanM: 8
80+
hSpanM: 8
8181
</code>
8282
</pre>
8383
</Cell>

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
verbose: true,
3+
setupFilesAfterEnv: ['./src/index.test.js'],
4+
testPathIgnorePatterns: ['./src/index.test.js'],
5+
};

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"ui"
1616
],
1717
"scripts": {
18-
"build": "yarn run lint && webpack --config webpack.production.config.js",
18+
"build": "yarn lint && yarn test && webpack --config webpack.production.config.js",
1919
"dev": "webpack-dev-server --hot --inline --config webpack.development.config.js",
2020
"lint": "eslint .",
21-
"test": "echo \"No test specified\""
21+
"test": "jest"
2222
},
2323
"peerDependencies": {
2424
"react": "^16.8.0"
@@ -35,19 +35,22 @@
3535
"@babel/plugin-proposal-class-properties": "^7.8.3",
3636
"@babel/preset-env": "^7.8.4",
3737
"@babel/preset-react": "^7.8.3",
38-
"@trbl/eslint-config": "^1.2.3",
38+
"@trbl/eslint-config": "^1.2.4",
3939
"babel-eslint": "^10.0.3",
4040
"babel-loader": "^8.0.6",
41+
"enzyme": "^3.11.0",
42+
"enzyme-adapter-react-16": "^1.15.2",
4143
"eslint": "^6.8.0",
4244
"eslint-loader": "^3.0.3",
43-
"eslint-plugin-import": "^2.20.0",
45+
"eslint-plugin-import": "^2.20.1",
4446
"eslint-plugin-jest": "^23.6.0",
4547
"eslint-plugin-jest-dom": "^2.0.0",
4648
"eslint-plugin-jsx-a11y": "^6.2.3",
47-
"eslint-plugin-react": "^7.18.0",
49+
"eslint-plugin-react": "^7.18.3",
4850
"eslint-plugin-react-hooks": "^2.3.0",
4951
"html-webpack-plugin": "^3.2.0",
5052
"husky": "^4.2.1",
53+
"jest": "^25.1.0",
5154
"lint-staged": "^10.0.6",
5255
"react-hot-loader": "^4.12.19",
5356
"webpack": "^4.41.5",

src/Cell/index.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
describe('Cell', () => {
2+
it.skip('skip', () => 1);
3+
});

src/GlobalStyles/index.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
describe('GlobalStyles', () => {
2+
it.skip('skip', () => 1);
3+
});

src/Grid/index.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
describe('Grid', () => {
2+
it.skip('skip', () => 1);
3+
});

src/GridProvider/index.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
describe('GridProvider', () => {
2+
it.skip('skip', () => 1);
3+
});

src/index.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { configure } from 'enzyme';
2+
import Adapter from 'enzyme-adapter-react-16';
3+
4+
configure({ adapter: new Adapter() });

0 commit comments

Comments
 (0)