Skip to content

Commit be5e057

Browse files
authored
housekeeping: npm audit resolutions (via #5457)
* add `security-audit` script * npm audit fix * remove nyc * nightwatch@1 this breaks the test suite, but it appears to have already regressed. leaving it for another day, TODO: open a backlog ticket * add `security-audit` script * disable mocha exclusivity * update package-lock.json * [email protected] * `npm audit fix` * @release-it/[email protected] * release-it@12
1 parent d542f98 commit be5e057

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+11517
-13391
lines changed

docs/development/scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Script name | Description
1919
`build-bundle` | Build `swagger-ui-bundle.js` only.
2020
`build-core` | Build `swagger-ui.(js\|css)` only.
2121
`build-standalone` | Build `swagger-ui-standalone-preset.js` only.
22+
`build-stylesheets` | Build `swagger-ui.css` only.
2223

2324
### Testing
2425
Script name | Description
2526
--- | ---
2627
`test` | Run unit tests in Node and run ESLint in errors-only mode.
2728
`just-test` | Run unit tests in the browser with Karma.
2829
`just-test-in-node` | Run unit tests in Node.
29-
`just-check-coverage` | Generate a code coverage report with NYC.
3030
`e2e` | Run end-to-end tests (requires JDK and Selenium).

package-lock.json

Lines changed: 11392 additions & 13308 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,18 @@
3131
"test": "run-s just-test-in-node e2e-cypress lint-errors",
3232
"test-in-node": "run-s lint-errors just-test-in-node",
3333
"just-test-in-node": "mocha --require test/setup.js --recursive --compilers js:@babel/register --require source-map-support test/core test/components test/bugs test/docker test/swagger-ui-dist-package test/xss",
34-
"just-check-coverage": "nyc npm run just-test-in-node",
3534
"test-e2e-cypress": "cypress run",
3635
"test-e2e-selenium": "sleep 3 && nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json",
3736
"e2e-initial-render": "nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json --group initial-render",
3837
"mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204",
3938
"hot-e2e-cypress-server": "webpack-dev-server --config webpack/dev-e2e.babel.js --content-base test/e2e-cypress/static",
40-
"hot-e2e-selenium-server": "webpack-dev-server --config webpack/dev-e2e.babel.js --content-base test/e2e-selenium/helpers",
39+
"hot-e2e-selenium-server": "webpack-dev-server --config webpack/dev-e2e.babel.js --content-base test/e2e-selenium/static",
4140
"e2e-cypress": "run-p -r hot-e2e-cypress-server mock-api test-e2e-cypress",
4241
"e2e-selenium": "run-p -r hot-e2e-selenium-server mock-api test-e2e-selenium",
4342
"open-static": "node -e 'require(\"open\")(\"http://localhost:3002\")'",
43+
"security-audit": "run-s -sc security-audit:all security-audit:prod",
44+
"security-audit:prod": "npm-audit-ci-wrapper -p -t low",
45+
"security-audit:all": "npm-audit-ci-wrapper -t moderate",
4446
"serve-static": "http-server dist/ -i -a 0.0.0.0 -p 3002",
4547
"start": "npm-run-all --parallel serve-static open-static"
4648
},
@@ -58,7 +60,7 @@
5860
"ieee754": "^1.1.8",
5961
"immutable": "^3.x.x",
6062
"js-file-download": "^0.4.1",
61-
"lodash": "^4.17.11",
63+
"lodash": "^4.17.14",
6264
"memoizee": "^0.4.12",
6365
"prop-types": "^15.5.10",
6466
"react": "^15.6.2",
@@ -90,19 +92,19 @@
9092
"@babel/preset-react": "^7.0.0",
9193
"@babel/register": "^7.4.4",
9294
"@babel/runtime-corejs2": "^7.0.0",
93-
"@release-it/conventional-changelog": "^1.0.0",
95+
"@release-it/conventional-changelog": "^1.1.0",
9496
"autoprefixer": "^8.4.1",
9597
"babel-eslint": "^9.0.0",
9698
"babel-loader": "^8.0.6",
9799
"babel-plugin-module-resolver": "^3.2.0",
98100
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
99101
"body-parser": "^1.18.3",
100-
"bundlesize": "^0.17.2",
102+
"bundlesize": "^0.18.0",
101103
"chromedriver": "^2.38.3",
102104
"copy-webpack-plugin": "^5.0.3",
103105
"cors": "^2.8.4",
104106
"css-loader": "^3.0.0",
105-
"cypress": "^3.3.1",
107+
"cypress": "^3.4.0",
106108
"dedent": "^0.7.0",
107109
"deepmerge": "^2.1.0",
108110
"enzyme": "^2.7.1",
@@ -119,24 +121,24 @@
119121
"imports-loader": "^0.8.0",
120122
"jsdom": "^11.10.0",
121123
"json-loader": "^0.5.7",
122-
"json-merger": "^1.1.0",
123-
"json-server": "^0.12.2",
124+
"json-merger": "^1.1.1",
125+
"json-server": "^0.15.0",
124126
"less": "^3.0.2",
125127
"license-checker": "^19.0.0",
126128
"mini-css-extract-plugin": "^0.7.0",
127129
"mocha": "^5.1.1",
128-
"nightwatch": "^0.9.16",
130+
"nightwatch": "^1.1.13",
129131
"node-sass": "^4.12.0",
132+
"npm-audit-ci-wrapper": "^2.3.0",
130133
"npm-run-all": "^4.1.2",
131-
"nyc": "^11.3.0",
132134
"oauth2-server": "^2.4.1",
133135
"open": "6.0.0",
134136
"optimize-css-assets-webpack-plugin": "^5.0.3",
135137
"postcss-loader": "^3.0.0",
136138
"prettier": "^1.18.2",
137139
"raw-loader": "3.0.0",
138140
"react-test-renderer": "^15.5.4",
139-
"release-it": "^11.0.0",
141+
"release-it": "^12.3.3",
140142
"rimraf": "^2.6.0",
141143
"sass-loader": "^7.1.0",
142144
"selenium-server-standalone-jar": "3.12.0",
@@ -153,12 +155,6 @@
153155
"config": {
154156
"deps_check_dir": ".deps_check"
155157
},
156-
"nyc": {
157-
"all": true,
158-
"include": [
159-
"**/src/core/plugins/**.js"
160-
]
161-
},
162158
"bundlesize": [
163159
{
164160
"path": "./dist/swagger-ui-bundle.js",

test/e2e-selenium/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
These tests are currently broken, and need to be either updated or migrated into
2+
`../e2e-cypress`.

test/e2e-selenium/db.json

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,96 @@
125125
}
126126
],
127127
"status": "available"
128+
},
129+
{
130+
"id": 8,
131+
"category": {
132+
"id": 0,
133+
"name": "string"
134+
},
135+
"name": "doggie",
136+
"photoUrls": [
137+
"string"
138+
],
139+
"tags": [
140+
{
141+
"id": 0,
142+
"name": "string"
143+
}
144+
],
145+
"status": "available"
146+
},
147+
{
148+
"id": 9,
149+
"category": {
150+
"id": 0,
151+
"name": "string"
152+
},
153+
"name": "doggie",
154+
"photoUrls": [
155+
"string"
156+
],
157+
"tags": [
158+
{
159+
"id": 0,
160+
"name": "string"
161+
}
162+
],
163+
"status": "available"
164+
},
165+
{
166+
"id": 10,
167+
"category": {
168+
"id": 0,
169+
"name": "string"
170+
},
171+
"name": "doggie",
172+
"photoUrls": [
173+
"string"
174+
],
175+
"tags": [
176+
{
177+
"id": 0,
178+
"name": "string"
179+
}
180+
],
181+
"status": "available"
182+
},
183+
{
184+
"id": 11,
185+
"category": {
186+
"id": 0,
187+
"name": "string"
188+
},
189+
"name": "doggie",
190+
"photoUrls": [
191+
"string"
192+
],
193+
"tags": [
194+
{
195+
"id": 0,
196+
"name": "string"
197+
}
198+
],
199+
"status": "available"
200+
},
201+
{
202+
"id": 12,
203+
"category": {
204+
"id": 0,
205+
"name": "string"
206+
},
207+
"name": "doggie",
208+
"photoUrls": [
209+
"string"
210+
],
211+
"tags": [
212+
{
213+
"id": 0,
214+
"name": "string"
215+
}
216+
],
217+
"status": "available"
128218
}
129219
]
130-
}
220+
}

test/e2e-selenium/nightwatch.json

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,17 @@
1515
}
1616
},
1717

18-
"selenium" : {
19-
"start_process" : true,
20-
"server_path" : "node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-3.12.0.jar",
21-
"log_path" : "",
22-
"host" : "127.0.0.1",
23-
"port" : 4444,
24-
"cli_args" : {
25-
"webdriver.chrome.driver" : "node_modules/chromedriver/bin/chromedriver",
26-
"webdriver.firefox.profile" : "",
27-
"webdriver.ie.driver" : ""
28-
}
18+
"webdriver": {
19+
"start_process": true,
20+
"server_path": "node_modules/.bin/chromedriver",
21+
"port": 9515
2922
},
3023

31-
"test_settings" : {
32-
"default" : {
33-
"launch_url" : "http://localhost",
34-
"selenium_port" : 4444,
35-
"selenium_host" : "localhost",
36-
"silent": true,
37-
"screenshots" : {
38-
"enabled" : false,
39-
"path" : ""
40-
},
41-
"desiredCapabilities": {
42-
"browserName": "chrome",
43-
"marionette": true
44-
}
45-
},
46-
47-
"chrome" : {
24+
"test_settings": {
25+
"default": {
4826
"desiredCapabilities": {
4927
"browserName": "chrome"
5028
}
51-
},
52-
53-
"edge" : {
54-
"desiredCapabilities": {
55-
"browserName": "MicrosoftEdge"
56-
}
5729
}
5830
}
5931
}

test/e2e-selenium/pages/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ module.exports = {
8585
}
8686
},
8787
apiWrapper: {
88-
selector: "div.swagger-ui > div:nth-child(2) > div:nth-child(5) > section > div",
88+
selector: "div.swagger-ui > div:nth-child(2) > div:nth-child(4) > section > div",
8989
elements: {
9090
petAPIWrapper: {
91-
selector: "div.swagger-ui div:nth-child(5) > section > div > span:nth-child(1) > div"
91+
selector: "div.swagger-ui div:nth-child(4) > section > div > span:nth-child(1) > div"
9292
},
9393
petAPIWrapperBar: {
94-
selector: "div.swagger-ui div:nth-child(5) > section > div > span:nth-child(1) > div .opblock-tag"
94+
selector: "div.swagger-ui div:nth-child(4) > section > div > span:nth-child(1) > div .opblock-tag"
9595
},
9696

9797
/**
@@ -319,10 +319,10 @@ module.exports = {
319319
* ***********Store************
320320
*/
321321
storeAPIWrapper: {
322-
selector: "div.swagger-ui div:nth-child(5) > section > div > span:nth-child(2) > div"
322+
selector: "div.swagger-ui div:nth-child(4) > section > div > span:nth-child(2) > div"
323323
},
324324
storeAPIWrapperBar: {
325-
selector: "div.swagger-ui div:nth-child(5) > section > div > span:nth-child(2) > div .opblock-tag"
325+
selector: "div.swagger-ui div:nth-child(4) > section > div > span:nth-child(2) > div .opblock-tag"
326326
},
327327
/**
328328
* Get /store/inventory
@@ -418,10 +418,10 @@ module.exports = {
418418
* *********User**************
419419
*/
420420
userAPIWrapper: {
421-
selector: "div.swagger-ui div:nth-child(5) > section > div > span:nth-child(3) > div"
421+
selector: "div.swagger-ui div:nth-child(4) > section > div > span:nth-child(3) > div"
422422
},
423423
userAPIWrapperBar: {
424-
selector: "div.swagger-ui div:nth-child(5) > section > div > span:nth-child(3) > div .opblock-tag"
424+
selector: "div.swagger-ui div:nth-child(4) > section > div > span:nth-child(3) > div .opblock-tag"
425425
},
426426
/**
427427
* Put /user/login

test/e2e-selenium/scenarios/bugs/4196.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ describe("bug #4196: HTTP basic auth credential retention", function () {
66
.page.main()
77

88
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
9-
.pause(80)
109
.clearValue(".download-url-input")
1110
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4196.yaml")
1211
.click("button.download-url-button")
13-
.pause(1000)
1412

1513
done()
1614
})
@@ -36,7 +34,7 @@ describe("bug #4196: HTTP basic auth credential retention", function () {
3634
.waitForElementVisible(`section>input[type="password"]`, 5000)
3735
.setValue(`section>input[type="password"]`, "bbb") // Set password
3836
.click(".auth-btn-wrapper button:nth-child(1)") // Click Authorize
39-
.pause(5000)
37+
.pause(1000)
4038
.assert.containsText("div.wrapper:nth-child(4)>code", "bbb")
4139

4240
client.end()

test/e2e-selenium/scenarios/bugs/4374.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ describe("bug #4374: OAS3 parameters should be visibly validated in Try-It-Out",
66
.page.main()
77

88
client.waitForElementVisible(".download-url-input:not([disabled])", 10000)
9-
.pause(1000)
109
.clearValue(".download-url-input")
1110
.setValue(".download-url-input", "/test-specs/bugs/4374.yaml")
1211
.click("button.download-url-button")

test/e2e-selenium/scenarios/bugs/4409.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ describe("bug #4409: operationId normalization and layout tracking", function ()
66
.page.main()
77

88
client.waitForElementVisible(".download-url-input:not([disabled])", 5000)
9-
.pause(5000)
109
.clearValue(".download-url-input")
1110
.setValue(".download-url-input", "http://localhost:3230/test-specs/bugs/4409.yaml")
1211
.click("button.download-url-button")

0 commit comments

Comments
 (0)