This repository has been archived by the owner on Nov 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): move to kcd-scripts (#7)
**What**: This moves all the tooling to kcd-scripts **Why**: Simplifies a bunch of stuff and makes it easier to keep things updated **How**: Remove a bunch of code and deps and use kcd-scripts instead
- Loading branch information
Kent C. Dodds
committed
Oct 10, 2017
1 parent
0df5637
commit 18e0add
Showing
20 changed files
with
160 additions
and
359 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
module.exports = { | ||
roots: ['./src'], | ||
testEnvironment: 'jsdom', | ||
collectCoverageFrom: ['src/**/*.js'], | ||
testPathIgnorePatterns: ['/node_modules/', '/fixtures/'], | ||
coveragePathIgnorePatterns: ['/node_modules/', '/fixtures/'], | ||
coverageThreshold: { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100, | ||
}, | ||
}, | ||
snapshotSerializers: ['jest-serializer-html', 'enzyme-to-json/serializer'], | ||
} | ||
const jestConfig = require('kcd-scripts/config').jest | ||
|
||
jestConfig.snapshotSerializers = jestConfig.snapshotSerializers || [] | ||
jestConfig.snapshotSerializers.push( | ||
'jest-serializer-html', | ||
'enzyme-to-json/serializer', | ||
) | ||
jestConfig.setupFiles = jestConfig.setupFiles || [] | ||
jestConfig.setupFiles.push('<rootDir>/other/setup-tests.js') | ||
|
||
module.exports = jestConfig |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const jestConfig = require('kcd-scripts/config').jest | ||
|
||
module.exports = Object.assign(jestConfig, { | ||
roots: ['.'], | ||
testEnvironment: 'jsdom', | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable */ | ||
/** | ||
* requestAnimationFrame polyfill from https://gist.github.com/paulirish/1579671 | ||
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | ||
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | ||
* requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | ||
* MIT license | ||
*/ | ||
|
||
var lastTime = 0 | ||
var vendors = ['ms', 'moz', 'webkit', 'o'] | ||
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | ||
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'] | ||
window.cancelAnimationFrame = | ||
window[vendors[x] + 'CancelAnimationFrame'] || | ||
window[vendors[x] + 'CancelRequestAnimationFrame'] | ||
} | ||
|
||
if (!window.requestAnimationFrame) { | ||
window.requestAnimationFrame = function(callback, element) { | ||
var currTime = new Date().getTime() | ||
var timeToCall = Math.max(0, 16 - (currTime - lastTime)) | ||
var id = window.setTimeout(function() { | ||
// eslint-disable-next-line consumerweb/no-callback-literal | ||
callback(currTime + timeToCall) | ||
}, timeToCall) | ||
lastTime = currTime + timeToCall | ||
return id | ||
} | ||
global.requestAnimationFrame = window.requestAnimationFrame | ||
} | ||
|
||
if (!window.cancelAnimationFrame) { | ||
window.cancelAnimationFrame = function(id) { | ||
clearTimeout(id) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line import/no-unassigned-import | ||
import './raf-polyfill' | ||
import Enzyme from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
|
||
Enzyme.configure({adapter: new Adapter()}) |
Oops, something went wrong.