swagger-js icon indicating copy to clipboard operation
swagger-js copied to clipboard

NPM run tests fails on a fresh cloned repo

Open sahilkhanna opened this issue 3 years ago • 0 comments

  • OS: Edition: Windows 11 Pro
  • OS build: 22000.434
  • Environment: NodeJS v14.18.1, NPM 8.1.0
  • Method of installation: git clone
  • Swagger-Client version: 3.18.3

Content & configuration

I freshly cloned repo with 3.18.3 Tag and was able to build it successfully however when I ran the tests test/build-artifacts/umd.js keeps on failing.

Log

`> Executing task: npm run test <

[email protected] test run-s test:unit:coverage test:artifact

[email protected] test:unit:coverage cross-env BABEL_ENV=commonjs jest --runInBand --config ./config/jest/jest.unit.coverage.config.js

PASS test/execute/main.js PASS test/specmap/refs.js PASS test/resolver.js PASS test/client.js PASS test/specmap/index.js PASS test/index.js PASS test/resolver/index.js PASS test/http/index.js PASS test/specmap/all-of.js PASS test/http/http-multipart.js PASS test/subtree-resolver.js PASS test/oas3/client.js PASS test/oas3/execute/main.js PASS test/specmap/parameters.js PASS test/oas3/execute/style-explode/query.js PASS test/oas3/execute/style-explode/path.js PASS test/oas3/execute/authorization.js PASS test/bugs/ui-4228.js PASS test/oas3/execute/build-request.js PASS test/bugs/ui-4466.js PASS test/oas3/execute/style-explode/header.js PASS test/bugs/editor-1661.js PASS test/specmap/properties.js PASS test/oas3/execute/style-explode/cookie.js PASS test/index-authorizations.js PASS test/execute/baseurl.js PASS test/interfaces.js PASS test/swagger2/execute/build-request.js PASS test/specmap/complex.js PASS test/bugs/ui-4071.js PASS test/bugs/1719.js PASS test/helpers.js PASS test/specmap/context-tree.js PASS test/specmap/live.js PASS test/swagger2/execute/apply-securities.js PASS test/oas3/helpers.js PASS test/oas3/execute/style-serializer.js PASS test/specmap/lib.js --------------------------------------|---------|----------|---------|---------|-------------------------------------------------------

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 90.97 88.31 93.37 91.42
src 94.41 86.9 100 94.28
commonjs.js 0 100 100 0 3-9
constants.js 100 100 100 100
helpers.js 93.06 88.42 100 92.85 17,26,60,65,101,138,147
index.js 100 96.87 100 100 70
interfaces.js 97.61 75 100 97.5 94
resolver.js 92 76.19 100 92 73,77
src/execute 96.5 92.99 100 96.37
index.js 96.5 92.99 100 96.37 67,164-165,211,231
src/execute/oas3 90.66 86.06 94.59 91.28
build-request.js 97.43 89.62 100 97.43 73,114
content-serializer.js 60 50 100 60 10,15
parameter-builders.js 95.23 87.75 100 95.23 38,42
style-serializer.js 85 82.35 92 86.02 10,18,88-98,158,183-187
src/execute/swagger2 98.76 93.91 100 98.73
build-request.js 98.38 93.1 100 98.33 81
parameter-builders.js 100 96.42 100 100 31
src/http 87.62 85.47 84.61 88.82
fold-formdata-to-request.browser.js 0 100 0 0 1-2
fold-formdata-to-request.node.js 100 100 100 100
index.js 88.02 85.47 86.48 89.32 55-56,154,167,238-243,253,360-361,435-443
src/specmap 91.66 88.59 90.56 91.93
helpers.js 95.23 88.23 83.33 95.23 54
index.js 91.22 88.65 91.48 91.51 17,60-67,203-204,227-228,248-249,335,372-373
src/specmap/lib 86.66 87.62 93.06 87.25
all-of.js 92.3 83.33 100 94.73 37,50
context-tree.js 97.56 96.66 100 97.5 57
create-error.js 90 50 100 90 4
index.js 70 78.26 82.5 70.58 37-39,136,163-166,174,192,203-226,235,293,301,334-335
parameters.js 69.23 75 100 69.23 15-17,25
properties.js 66.66 100 100 66.66 13-15
refs.js 96.73 93.37 100 96.64 188,213,293,412,461
src/subtree-resolver 100 100 100 100
index.js 100 100 100 100
-------------------------------------- --------- ---------- --------- --------- -------------------------------------------------------

Test Suites: 38 passed, 38 total Tests: 18 skipped, 523 passed, 541 total Snapshots: 0 total Time: 12.991 s Ran all test suites.

[email protected] test:artifact run-s test:artifact:umd:browser test:artifact:es test:artifact:commonjs

[email protected] test:artifact:umd:browser npm run build:umd:browser && cross-env BABEL_ENV=browser jest --config ./config/jest/jest.artifact-umd-browser.config.js

[email protected] build:umd:browser cross-env BABEL_ENV=browser webpack --progress --config config/webpack/browser.config.babel.js

WARNING (@babel/preset-env): The corejs option only has an effect when the useBuiltIns option is not false

10% building 0/1 entries 1/1 dependencies 0/1 modules WARNING (@babel/preset-env): The corejs option only has an effect when the useBuiltIns option is not false

95% emitting emit inspectpack-duplicates-plugin Duplicate Sources / Packages - No duplicates found. 🚀

asset swagger-client.browser-stats.json 7.51 MiB [emitted] [big] asset swagger-client.browser.js 859 KiB [compared for emit] [big] (name: main) runtime modules 1.28 KiB 7 modules modules by path ./node_modules/core-js-pure/ 284 KiB 379 modules modules by path ./node_modules/@babel/runtime-corejs3/ 15.4 KiB 77 modules modules by path ./src/ 144 KiB 24 modules modules by path ./node_modules/qs/lib/.js 25.2 KiB 5 modules modules by path ./node_modules/fast-json-patch/ 31.7 KiB 4 modules modules by path ./node_modules/querystring/.js 4.91 KiB 3 modules modules by path ./node_modules/url/.js 23.8 KiB 2 modules modules by path ./node_modules/lodash/.js 1.18 KiB 2 modules modules by path ./node_modules/call-bind/.js 1.73 KiB 2 modules modules by path ./node_modules/has-symbols/.js 3.07 KiB 2 modules modules by path ./node_modules/function-bind/*.js 1.63 KiB 2 modules

  • 15 modules webpack 5.67.0 compiled successfully in 14840 ms

asset swagger-client.browser.min.js 249 KiB [compared for emit] [minimized] (name: main) 2 related assets orphan modules 290 KiB [orphan] 49 modules runtime modules 1.28 KiB 7 modules modules by path ./node_modules/core-js-pure/ 284 KiB 379 modules modules by path ./node_modules/@babel/runtime-corejs3/ 4.32 KiB 58 modules modules by path ./node_modules/qs/lib/.js 25.2 KiB 5 modules modules by path ./node_modules/querystring/.js 4.91 KiB 3 modules modules by path ./node_modules/url/.js 23.8 KiB 2 modules modules by path ./node_modules/lodash/.js 1.18 KiB 2 modules modules by path ./node_modules/call-bind/.js 1.73 KiB 2 modules modules by path ./node_modules/has-symbols/.js 3.07 KiB 2 modules modules by path ./node_modules/function-bind/*.js 1.63 KiB 2 modules

  • 13 modules webpack 5.67.0 compiled successfully in 17641 ms FAIL test/build-artifacts/umd.js ● Test suite failed to run

    TypeError: _concatInstanceProperty is not a function

    974 | var entryVirtual = __webpack_require__(52348);
    975 |
    

    976 | module.exports = _concatInstanceProperty(entryVirtual('Array')); | ^ 977 | 978 | /***/ }), 979 |

    at Object.call (dist/swagger-client.browser.js:976:18)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:1178:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:11870:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:24:18)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:7047:31)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:1719:1)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:12239:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:909:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:2002:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:395:18)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:409:15)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:3795:15)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:7919:9)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:9974:1)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:1883:1)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:311:18)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:4112:19)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:4201:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:6585:21)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:7385:23)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:10102:1)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:11981:1)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:66:18)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:1581:29)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:12172:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:891:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:1975:14)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Object.call (dist/swagger-client.browser.js:381:18)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at Module.call (dist/swagger-client.browser.js:23378:100)
    at __webpack_require__ (dist/swagger-client.browser.js:28451:42)
    at dist/swagger-client.browser.js:28537:102
    at dist/swagger-client.browser.js:28530:1
    at factory (dist/swagger-client.browser.js:11:17)
    at webpackUniversalModuleDefinition (dist/swagger-client.browser.js:3:20)
    at Object.<anonymous> (dist/swagger-client.browser.js:1:1)
    at Object.<anonymous> (test/build-artifacts/umd.js:4:1)
    at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
    at runJest (node_modules/@jest/core/build/runJest.js:404:19)
    at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)
    at runCLI (node_modules/@jest/core/build/cli/index.js:173:3)
    

Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total Time: 4.673 s Ran all test suites. ERROR: "test:artifact:umd:browser" exited with 1. ERROR: "test:artifact" exited with 1.`

sahilkhanna avatar Jan 31 '22 11:01 sahilkhanna