This repository was archived by the owner on May 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +2379
-47
lines changed Expand file tree Collapse file tree 4 files changed +2379
-47
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Configure Jest as the test runner for @testing-library
3
+ *
4
+ * @see https://jestjs.io/docs/en/configuration
5
+ */
6
+ module . exports = {
7
+ setupFilesAfterEnv : [
8
+ '@testing-library/jest-dom/extend-expect' ,
9
+ 'babel-polyfill'
10
+ ] ,
11
+ collectCoverage : true ,
12
+ coveragePathIgnorePatterns : [ '/node_modules/' , '/__tests__/' ] ,
13
+ testMatch : [ '**/__tests__/**/*.(spec|test).[jt]s?(x)' ]
14
+ } ;
Original file line number Diff line number Diff line change 35
35
"build" : " rollup -c" ,
36
36
"start" : " rollup -c -w" ,
37
37
"prepare" : " yarn run build" ,
38
+ "test" : " jest" ,
39
+ "test:watch" : " jest --watch" ,
38
40
"dev" : " npm run start --prefix dev" ,
39
41
"lint-js" : " eslint --ignore-path .gitignore --ignore-pattern \" !**/.*\" ." ,
40
42
"fix-js" : " yarn run lint-js --fix"
74
76
"@babel/plugin-transform-runtime" : " ^7.5.0" ,
75
77
"@babel/preset-env" : " ^7.5.4" ,
76
78
"@babel/preset-react" : " ^7.0.0" ,
79
+ "@testing-library/jest-dom" : " ^4.1.0" ,
80
+ "@testing-library/react" : " ^9.1.3" ,
77
81
"babel-eslint" : " 10.0.2" ,
78
82
"babel-plugin-transform-react-remove-prop-types" : " ^0.4.24" ,
83
+ "babel-polyfill" : " ^6.26.0" ,
79
84
"eslint" : " ^6.2.0" ,
80
85
"eslint-config-airbnb" : " ^18.0.1" ,
81
86
"eslint-config-prettier" : " ^6.1.0" ,
85
90
"eslint-plugin-react" : " ^7.14.2" ,
86
91
"eslint-plugin-react-hooks" : " ^1.7.0" ,
87
92
"husky" : " ^3.0.4" ,
93
+ "jest" : " ^24.9.0" ,
88
94
"lint-staged" : " ^9.2.3" ,
89
95
"prettier" : " ^1.18.2" ,
90
96
"prop-types" : " ^15.7.2" ,
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { render } from '@testing-library/react' ;
3
+ import DatGUI from '../../dist/index.cjs' ;
4
+
5
+ test ( 'Renders without errors' , ( ) => {
6
+ render ( < DatGUI data = { { data : { } } } onUpdate = { ( ) => null } /> ) ;
7
+ } ) ;
You can’t perform that action at this time.
0 commit comments