diff --git a/.travis.yml b/.travis.yml index 3fba3e4e..c475eb5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,6 @@ node_js: cache: directories: - node_modules -env: - global: - - NODE_ENV=production install: - sudo apt-get update && sudo apt-get install -y libcairo2-dev libpango1.0-dev libssl-dev libjpeg62-dev libgif-dev pkg-config - npm install canvas @@ -35,4 +32,3 @@ deploy: skip_cleanup: true email: $NPM_EMAIL api_key: $NPM_TOKEN - \ No newline at end of file diff --git a/package.json b/package.json index 3e56fbb8..5985c099 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "i18n:src": "babel src > tmp.js && rimraf tmp.js && ./scripts/build-i18n-source.js ./translations/messages/ ./translations/", "lint": "eslint . --ext .js,.jsx", "start": "npm run i18n:msgs && webpack-dev-server", - "test": "npm run lint && npm run build && npm run unit", + "test": "npm run lint && npm run unit && NODE_ENV=production npm run build", "unit": "jest", "watch": "webpack --progress --colors --watch" }, @@ -23,8 +23,8 @@ "url": "git+ssh://git@github.com/LLK/scratch-paint.git" }, "peerDependencies": { - "react": "^15", - "react-dom": "^15" + "react": "^16", + "react-dom": "^16" }, "devDependencies": { "autoprefixer": "7.1.2", @@ -39,7 +39,8 @@ "babel-preset-react": "^6.22.0", "classnames": "2.2.5", "css-loader": "0.28.3", - "enzyme": "^2.8.2", + "enzyme": "^3.1.0", + "enzyme-adapter-react-16": "^1.0.1", "eslint": "^4.4.1", "eslint-config-import": "^0.13.0", "eslint-config-scratch": "^4.0.0", @@ -58,12 +59,13 @@ "postcss-loader": "^2.0.5", "postcss-simple-vars": "^4.0.0", "prop-types": "^15.5.10", - "react": "15.6.1", - "react-dom": "15.6.1", - "react-intl": "2.3.0", + "raf": "^3.4.0", + "react": "16.0.0", + "react-dom": "16.0.0", + "react-intl": "2.4.0", "react-intl-redux": "0.6.0", "react-redux": "5.0.5", - "react-test-renderer": "^15.5.4", + "react-test-renderer": "^16.0.0", "redux": "3.7.0", "redux-mock-store": "^1.2.3", "redux-throttle": "0.1.1", @@ -75,6 +77,10 @@ "webpack-dev-server": "^2.7.0" }, "jest": { + "setupFiles": [ + "raf/polyfill", + "/test/helpers/enzyme-setup.js" + ], "moduleNameMapper": { "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/test/__mocks__/fileMock.js", "\\.(css|less)$": "/test/__mocks__/styleMock.js" diff --git a/test/helpers/enzyme-setup.js b/test/helpers/enzyme-setup.js new file mode 100644 index 00000000..5374f679 --- /dev/null +++ b/test/helpers/enzyme-setup.js @@ -0,0 +1,4 @@ +import Enzyme from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; + +Enzyme.configure({adapter: new Adapter()});