From da935423dbe36d5ce278b5b884de023d81992951 Mon Sep 17 00:00:00 2001 From: Misha Moroshko Date: Wed, 15 Aug 2018 20:52:11 -0700 Subject: [PATCH] Upgrade deps --- .../components/CustomRender/CustomRender.js | 3 +- package.json | 69 +++++++++++++------ .../AutosuggestApp.test.js | 19 ++--- test/helpers.js | 12 ++-- test/plain-list/AutosuggestApp.test.js | 38 +++++----- 5 files changed, 86 insertions(+), 55 deletions(-) diff --git a/demo/src/components/App/components/Examples/components/CustomRender/CustomRender.js b/demo/src/components/App/components/Examples/components/CustomRender/CustomRender.js index 6689dfff..07e1f1e4 100644 --- a/demo/src/components/App/components/Examples/components/CustomRender/CustomRender.js +++ b/demo/src/components/App/components/Examples/components/CustomRender/CustomRender.js @@ -94,7 +94,8 @@ export default class CustomRender extends Component {
Custom render
- Apply any styling you wish.
+ Apply any styling you wish. +
For example, render images and highlight the matching string.
", "scripts": { "start": "mkdir -p demo/dist && npm run copy-static-files && node server", - "prettier": - "prettier --single-quote --write \".*.js\" \"*.js\" \"demo/src/**/*.js\" \"demo/standalone/app.js\" \"src/**/*.js\" \"test/**/*.js\"", - "lint": - "eslint src test demo/src demo/standalone/app.js server.js webpack.*.js", + "prettier": "prettier --single-quote --write \".*.js\" \"*.js\" \"demo/src/**/*.js\" \"demo/standalone/app.js\" \"src/**/*.js\" \"test/**/*.js\"", + "lint": "eslint src test demo/src demo/standalone/app.js server.js webpack.*.js", "test": "nyc mocha \"test/**/*.test.js\"", - "copy-static-files": - "cp demo/src/index.html demo/src/components/App/components/Examples/components/Basic/autosuggest.css demo/dist/", + "copy-static-files": "cp demo/src/index.html demo/src/components/App/components/Examples/components/Basic/autosuggest.css demo/dist/", "dist": "rm -rf dist && mkdir dist && babel src -d dist", - "demo-dist": - "rm -rf demo/dist && mkdir demo/dist && npm run copy-static-files && cross-env BABEL_ENV=production webpack --config webpack.gh-pages.config.js", - "standalone": - "cross-env BABEL_ENV=production webpack --config webpack.standalone.config.js && webpack --config webpack.standalone-demo.config.js", + "demo-dist": "rm -rf demo/dist && mkdir demo/dist && npm run copy-static-files && cross-env BABEL_ENV=production webpack --config webpack.gh-pages.config.js", + "standalone": "cross-env BABEL_ENV=production webpack --config webpack.standalone.config.js && webpack --config webpack.standalone-demo.config.js", "prebuild": "npm run prettier && npm run lint && npm test", "build": "npm run dist && npm run standalone", "gh-pages-build": "npm run prebuild && npm run demo-dist", @@ -69,7 +64,7 @@ "nyc": "^10.1.2", "openurl": "^1.1.1", "postcss-loader": "^1.3.3", - "prettier": "1.7.4", + "prettier": "1.14.2", "react": "^15.6.1", "react-dom": "^15.6.1", "react-modal": "^1.7.7", @@ -83,14 +78,34 @@ "webpack": "^1.14.0", "webpack-dev-server": "^1.16.2" }, - "files": ["dist"], + "files": [ + "dist" + ], "lint-staged": { - ".*.js": ["npm run prettier", "git add"], - "*.js": ["npm run prettier", "git add"], - "demo/src/**/*.js": ["npm run prettier", "git add"], - "demo/standalone/app.js": ["npm run prettier", "git add"], - "src/**/*.js": ["npm run prettier", "git add"], - "test/**/*.js": ["npm run prettier", "git add"] + ".*.js": [ + "npm run prettier", + "git add" + ], + "*.js": [ + "npm run prettier", + "git add" + ], + "demo/src/**/*.js": [ + "npm run prettier", + "git add" + ], + "demo/standalone/app.js": [ + "npm run prettier", + "git add" + ], + "src/**/*.js": [ + "npm run prettier", + "git add" + ], + "test/**/*.js": [ + "npm run prettier", + "git add" + ] }, "keywords": [ "autosuggest", @@ -116,10 +131,20 @@ "branches": 91, "functions": 100, "lines": 95, - "include": ["src/*.js"], - "exclude": ["test/**/*.js"], - "reporter": ["lcov", "text-summary"], - "require": ["babel-register", "./test/setup.js"], + "include": [ + "src/*.js" + ], + "exclude": [ + "test/**/*.js" + ], + "reporter": [ + "lcov", + "text-summary" + ], + "require": [ + "babel-register", + "./test/setup.js" + ], "check-coverage": true }, "license": "MIT" diff --git a/test/focus-first-suggestion/AutosuggestApp.test.js b/test/focus-first-suggestion/AutosuggestApp.test.js index 6048865b..9a4cc66c 100644 --- a/test/focus-first-suggestion/AutosuggestApp.test.js +++ b/test/focus-first-suggestion/AutosuggestApp.test.js @@ -128,15 +128,16 @@ describe('Autosuggest with highlightFirstSuggestion={true}', () => { onSuggestionSelected.reset(); clickEnter(); expect(onSuggestionSelected).to.have.been.calledOnce; - expect( - onSuggestionSelected - ).to.have.been.calledWithExactly(syntheticEventMatcher, { - suggestion: { name: 'Perl', year: 1987 }, - suggestionValue: 'Perl', - suggestionIndex: 0, - sectionIndex: null, - method: 'enter' - }); + expect(onSuggestionSelected).to.have.been.calledWithExactly( + syntheticEventMatcher, + { + suggestion: { name: 'Perl', year: 1987 }, + suggestionValue: 'Perl', + suggestionIndex: 0, + sectionIndex: null, + method: 'enter' + } + ); }); }); diff --git a/test/helpers.js b/test/helpers.js index 3e584e75..966132be 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -92,11 +92,13 @@ export const getSuggestion = suggestionIndex => { throw Error( ` Cannot find suggestion #${suggestionIndex}. - ${suggestions.length === 0 - ? 'No suggestions found.' - : `Only ${suggestions.length} suggestion${suggestions.length === 1 - ? '' - : 's'} found.`} + ${ + suggestions.length === 0 + ? 'No suggestions found.' + : `Only ${suggestions.length} suggestion${ + suggestions.length === 1 ? '' : 's' + } found.` + } ` ); } diff --git a/test/plain-list/AutosuggestApp.test.js b/test/plain-list/AutosuggestApp.test.js index db0efcd7..98418122 100644 --- a/test/plain-list/AutosuggestApp.test.js +++ b/test/plain-list/AutosuggestApp.test.js @@ -563,30 +563,32 @@ describe('Default Autosuggest', () => { it('should be called once with the right parameters when suggestion is clicked', () => { clickSuggestion(1); expect(onSuggestionSelected).to.have.been.calledOnce; - expect( - onSuggestionSelected - ).to.have.been.calledWithExactly(syntheticEventMatcher, { - suggestion: { name: 'JavaScript', year: 1995 }, - suggestionValue: 'JavaScript', - suggestionIndex: 1, - sectionIndex: null, - method: 'click' - }); + expect(onSuggestionSelected).to.have.been.calledWithExactly( + syntheticEventMatcher, + { + suggestion: { name: 'JavaScript', year: 1995 }, + suggestionValue: 'JavaScript', + suggestionIndex: 1, + sectionIndex: null, + method: 'click' + } + ); }); it('should be called once with the right parameters when Enter is pressed and suggestion is highlighted', () => { clickDown(); clickEnter(); expect(onSuggestionSelected).to.have.been.calledOnce; - expect( - onSuggestionSelected - ).to.have.been.calledWithExactly(syntheticEventMatcher, { - suggestion: { name: 'Java', year: 1995 }, - suggestionValue: 'Java', - suggestionIndex: 0, - sectionIndex: null, - method: 'enter' - }); + expect(onSuggestionSelected).to.have.been.calledWithExactly( + syntheticEventMatcher, + { + suggestion: { name: 'Java', year: 1995 }, + suggestionValue: 'Java', + suggestionIndex: 0, + sectionIndex: null, + method: 'enter' + } + ); }); it('should not be called when Enter is pressed and there is no highlighted suggestion', () => {