1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-25 07:05:52 +03:00

Adjust test setup

This commit is contained in:
Brent Jackson 2020-02-02 12:29:55 -05:00
parent e7fbc41db4
commit d86cf0914d
5 changed files with 44 additions and 883 deletions

View File

@ -13,26 +13,51 @@
"cypress:open": "cypress open", "cypress:open": "cypress open",
"cypress:run": "cypress run", "cypress:run": "cypress run",
"test:dev": "start-server-and-test start http://localhost:8000 cypress:open", "test:dev": "start-server-and-test start http://localhost:8000 cypress:open",
"test": "start-server-and-test start http://localhost:8000 cypress:run" "jest": "jest",
"test": "jest && start-server-and-test start http://localhost:8000 cypress:run"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"@testing-library/react": "^9.4.0",
"cypress": "^3.4.0", "cypress": "^3.4.0",
"husky": "^4.2.1", "husky": "^4.2.1",
"jest": "^24.3.1", "jest": "^25.1.0",
"jest-emotion": "^10.0.27",
"lerna": "^3.13.1", "lerna": "^3.13.1",
"lint-staged": "^10.0.4", "lint-staged": "^10.0.4",
"prettier": "^1.16.4", "prettier": "^1.16.4",
"react-test-renderer": "^16.12.0",
"start-server-and-test": "^1.9.1" "start-server-and-test": "^1.9.1"
}, },
"jest": { "jest": {
"coverageReporters": [ "testMatch": [
"lcov", "**/packages/**/test/*.js"
"html"
], ],
"testPathIgnorePatterns": [ "testPathIgnorePatterns": [
"/node_modules/", "/node_modules/",
"/.cache/", "/.cache/",
"/public/" "/public/"
],
"coverageReporters": [
"lcov",
"text",
"html"
],
"collectCoverageFrom": [
"packages/**/src/**/*.js"
],
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
},
"snapshotSerializers": [
"jest-emotion"
] ]
}, },
"husky": { "husky": {

View File

@ -6,8 +6,7 @@
"license": "MIT", "license": "MIT",
"repository": "github:jxnblk/mdx-deck", "repository": "github:jxnblk/mdx-deck",
"scripts": { "scripts": {
"start": "gatsby develop --open", "start": "gatsby develop --open"
"test": "jest"
}, },
"peerDependencies": { "peerDependencies": {
"gatsby": "^2.14.0", "gatsby": "^2.14.0",
@ -25,44 +24,5 @@
"remark-images": "^1.0.0", "remark-images": "^1.0.0",
"remark-unwrap-images": "^1.0.0", "remark-unwrap-images": "^1.0.0",
"theme-ui": "^0.3.0-alpha.6" "theme-ui": "^0.3.0-alpha.6"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"@testing-library/react": "^9.4.0",
"cypress": "^3.4.0",
"jest": "^25.1.0",
"jest-emotion": "^10.0.27",
"lerna": "^3.13.1",
"react-test-renderer": "^16.12.0"
},
"jest": {
"testMatch": [
"**/test/*.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
],
"snapshotSerializers": [
"jest-emotion"
],
"coverageReporters": [
"lcov",
"text",
"html"
],
"collectCoverageFrom": [
"**/src/**/*.js"
],
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
} }
} }

View File

@ -18,11 +18,12 @@ const Comp = ({
originalType, originalType,
mdxType, mdxType,
...props ...props
}) => <div {...props} /> }) => React.createElement(originalType, props)
const x = (tag, props, children) => const x = (tag, props, children) =>
React.createElement(Comp, { React.createElement(Comp, {
key: __key++, key: __key++,
tag,
originalType: tag, originalType: tag,
mdxType: tag, mdxType: tag,
...props ...props

847
yarn.lock

File diff suppressed because it is too large Load Diff