⬆️ Mise à jour des dépendances JS

Mise en commun des tests pour mutualiser le désormais nécessaire
mock-local-storage
pull/291/head
Mael 2018-09-03 17:05:37 +02:00
parent ee3ee57b7f
commit a24387076c
3 changed files with 593 additions and 492 deletions

View File

@ -8,10 +8,7 @@
"engines": {
"node": ">=8.10.0 <10.0.0"
},
"browserslist": [
"> 1% in FR",
"not ie < 11"
],
"browserslist": ["> 1% in FR", "not ie < 11"],
"dependencies": {
"@researchgate/react-intersection-observer": "^0.7.3",
"classnames": "^2.2.5",
@ -54,19 +51,25 @@
},
"scripts": {
"compile": "webpack --config source/webpack.prod.js",
"eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check",
"eslint": "LIST=`git diff --cached --name-only --diff-filter=AMR HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
"eslint-check":
"eslint --print-config .eslintrc | eslint-config-prettier-check",
"eslint":
"LIST=`git diff --cached --name-only --diff-filter=AMR HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
"externalize": "node source/externalize.js",
"heroku-postbuild": "yarn install --production=false && yarn compile",
"prepare": "flow-typed update-cache",
"pretest": "LIST=`git diff --name-only --diff-filter=AMR HEAD^..HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi && flow check",
"pretest":
"LIST=`git diff --name-only --diff-filter=AMR HEAD^..HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi && flow check",
"start": "webpack-serve ./source/webpack.dev.js",
"test-components": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require test/helpers/browser.js \"source/components/**/*.test.js\" --watch",
"test-inversions": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js \"test/inversion.test.js\" --watch",
"test-meca": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js test/mecanisms.test.js --watch",
"test-rules": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js test/real-rules.test.js --watch",
"test-watch": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --require test/helpers/browser.js \"test/**/*.test.js\" --watch",
"test": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\""
"test-inversions": "yarn test-watch --grep 'inversions'",
"test-meca": "yarn test-watch --grep 'Mécanismes'",
"test-rules": "yarn test-watch --grep 'notre base de règles'",
"test-watch": "yarn test-common --watch",
"test-common":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\"",
"test": "yarn test-common",
"test-components":
"mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage ---require test/helpers/browser.js \"source/components/**/*.test.js\" --watch"
},
"devDependencies": {
"@babel/core": "=7.0.0-beta.51",
@ -97,10 +100,10 @@
"dedent-js": "^1.0.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^5.0.1",
"eslint-config-prettier": "^2.9.0",
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-flowtype": "^2.46.3",
"eslint-plugin-react": "^7.10.0",
"eslint-plugin-react": "^7.11.1",
"file-loader": "^1.1.11",
"flow-bin": "^0.72.0",
"flow-typed": "^2.4.0",
@ -110,12 +113,13 @@
"intl": "^1.2.5",
"intl-locales-supported": "^1.0.0",
"js-yaml": "^3.12.0",
"jsdom": "^11.11.0",
"jsdom": "^12.0.0",
"json-loader": "^0.5.7",
"koa-connect": "^2.0.1",
"live-server": "^1.2.0",
"mocha": "^5.0.4",
"mocha-webpack": "^2.0.0-beta.0",
"mock-local-storage": "^1.0.5",
"nearley-loader": "^2.0.0",
"postcss-loader": "^2.1.2",
"ramda-fantasy": "^0.8.0",

View File

@ -1,12 +1,13 @@
var jsdom = require('jsdom/lib/old-api').jsdom
var jsdom = require('jsdom')
const { JSDOM } = jsdom
var exposedProperties = ['window', 'navigator', 'document']
global.document = jsdom('')
const { document } = new JSDOM('').window
global.document = document
global.window = document.defaultView
window.console = global.console
Object.keys(document.defaultView).forEach(property => {
if (typeof global[property] === 'undefined') {
exposedProperties.push(property)
global[property] = document.defaultView[property]
}
})
@ -14,6 +15,3 @@ Object.keys(document.defaultView).forEach(property => {
global.navigator = {
userAgent: 'node.js'
}
documentRef = document
global.HTMLElement = window.HTMLElement

1033
yarn.lock

File diff suppressed because it is too large Load Diff