question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't pass npm run test

See original GitHub issue

Issue type:

[x] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[x] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

Environment: archlinux x64

git clone https://github.com/typeorm/typeorm.git
cd typeorm
docker-compose up
npm run watch

➜  typeorm git:(master) ✗ npm run test-fast

> typeorm@0.2.28 test-fast /home/jeiea/Documents/project/2020-10/typeorm
> mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test



  ✓ github issues > #3158 Cannot run sync a second time (456ms)
  ✓ github issues > #3588 Migration:generate issue with onUpdate using mysql 8.0 (80ms)
  benchmark > bulk-save > case1
    ✓ testing bulk save of 10.000 objects (595ms)

  benchmark > bulk-save > case2
    ✓ testing bulk save of 10000 objects (858ms)

  benchmark > bulk-save > case-querybuilder
    ✓ testing bulk save of 10000 objects (237ms)

  column kinds > create date column
    1) "before all" hook for "create date column should automatically be set by a database"
    2) "after all" hook for "create date column should set a custom date when specified"


  5 passing (2s)
  2 failing

  1) column kinds > create date column
       "before all" hook for "create date column should automatically be set by a database":
     DriverPackageNotInstalledError: SAP Hana package has not been found installed. Try to install it: npm install hdb-pool --save
      at new DriverPackageNotInstalledError (src/error/DriverPackageNotInstalledError.ts:8:9)
      at SapDriver.loadDependencies (src/driver/sap/SapDriver.ts:654:19)
      at new SapDriver (src/driver/sap/SapDriver.ts:200:14)
      at DriverFactory.create (src/driver/DriverFactory.ts:39:24)
      at new Connection (src/connection/Connection.ts:128:43)
      at ConnectionManager.create (src/connection/ConnectionManager.ts:64:28)
      at /home/jeiea/Documents/project/2020-10/typeorm/src/index.ts:242:71
      at Array.map (<anonymous>)
      at Object.<anonymous> (src/index.ts:242:33)
      at step (node_modules/tslib/tslib.js:141:27)
      at Object.next (node_modules/tslib/tslib.js:122:57)
      at /home/jeiea/Documents/project/2020-10/typeorm/node_modules/tslib/tslib.js:115:75
      at new Promise (<anonymous>)
      at Object.__awaiter (node_modules/tslib/tslib.js:111:16)
      at Object.createConnections (build/compiled/src/index.js:209:20)
      at Object.<anonymous> (test/utils/test-utils.ts:244:31)
      at step (node_modules/tslib/tslib.js:141:27)
      at Object.next (node_modules/tslib/tslib.js:122:57)
      at /home/jeiea/Documents/project/2020-10/typeorm/node_modules/tslib/tslib.js:115:75
      at new Promise (<anonymous>)
      at Object.__awaiter (node_modules/tslib/tslib.js:111:16)
      at Object.createTestingConnections (build/compiled/test/utils/test-utils.js:99:20)
      at /home/jeiea/Documents/project/2020-10/typeorm/test/core/column-kinds/create-date-column/create-date-column.ts:15:44
      at step (node_modules/tslib/tslib.js:141:27)
      at Object.next (node_modules/tslib/tslib.js:122:57)
      at /home/jeiea/Documents/project/2020-10/typeorm/node_modules/tslib/tslib.js:115:75
      at new Promise (<anonymous>)
      at Object.__awaiter (node_modules/tslib/tslib.js:111:16)
      at Context.<anonymous> (test/core/column-kinds/create-date-column/create-date-column.ts:15:12)
      at processImmediate (internal/timers.js:461:21)

  2) column kinds > create date column
       "after all" hook for "create date column should set a custom date when specified":
     TypeError: Cannot read property 'map' of undefined
      at Object.closeTestingConnections (test/utils/test-utils.ts:289:36)
      at Context.<anonymous> (test/core/column-kinds/create-date-column/create-date-column.ts:19:17)
      at processImmediate (internal/timers.js:461:21)



npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! typeorm@0.2.28 test-fast: `mocha --file ./build/compiled/test/utils/test-setup.js --bail --recursive --timeout 60000 ./build/compiled/test`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the typeorm@0.2.28 test-fast script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

➜  typeorm git:(master) ✗ npm i -D hdb-pool
npm WARN acorn-jsx@5.2.0 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/mocha/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ hdb-pool@0.1.6
added 1 package from 1 contributor and audited 1376 packages in 6.111s

70 packages are looking for funding
  run `npm fund` for details

found 5 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
➜  typeorm git:(master) ✗ node
Welcome to Node.js v14.9.0.
Type ".help" for more information.
> require('hdb-pool')
Uncaught Error: Cannot find module either '@sap/hana-client' or 'hdb'
    at Function.getHanaClient (/home/jeiea/Documents/project/2020-10/typeorm/node_modules/hdb-pool/lib/Utils.js:119:23)
    at Object.<anonymous> (/home/jeiea/Documents/project/2020-10/typeorm/node_modules/hdb-pool/lib/Factory.js:4:20)
    at Module._compile (internal/modules/cjs/loader.js:1075:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1096:10)
    at Module.load (internal/modules/cjs/loader.js:940:32)
    at Function.Module._load (internal/modules/cjs/loader.js:781:14)
    at Module.require (internal/modules/cjs/loader.js:964:19)
    at require (internal/modules/cjs/helpers.js:88:18) {
  code: 'MODULE_NOT_FOUND'
}
> .exit
➜  typeorm git:(master) ✗ npm i -D @sap/hana-client

> @sap/hana-client@2.6.54 install /home/jeiea/Documents/project/2020-10/typeorm/node_modules/@sap/hana-client
> node checkbuild.js

FATAL ERROR: A fatal error occurred during install.
Cannot find module '/home/jeiea/Documents/project/2020-10/typeorm/node_modules/@sap/hana-client/prebuilt/linuxx86_64-gcc48/hana-client.node'
Require stack:
- /home/jeiea/Documents/project/2020-10/typeorm/node_modules/@sap/hana-client/lib/index.js
- /home/jeiea/Documents/project/2020-10/typeorm/node_modules/@sap/hana-client/checkbuild.js
npm WARN acorn-jsx@5.2.0 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/mocha/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! @sap/hana-client@2.6.54 install: `node checkbuild.js`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the @sap/hana-client@2.6.54 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jeiea/.npm/_logs/2020-10-08T22_20_14_623Z-debug.log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
imnotjamescommented, Oct 9, 2020

Omit it from your ormconfig

0reactions
imnotjamescommented, Oct 9, 2020

For other questions, please check out the community slack or check TypeORM’s documentation page on other support avenues - cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

resemblejs "npm run test" tests not passing, can't extend timeout
and have been attempting to test the software by using the "npm run test" command. The test suites fail and it does not...
Read more >
Npm test never stops executing · Discussion #25250 - GitHub
It seems that when you execute the command npm test , you should explicitly set the environment variable CI , no matter its...
Read more >
start-server-and-test - npm
To execute all tests simply run npm run ci . Commands. In addition to using NPM script names, you can pass entire commands...
Read more >
NPM run test pass/fail colors in console - Codecademy Forums
I noticed in the walkthrough video his tests turn green and red, depending on whether or not the individual test case passes or...
Read more >
Npm test passes but doesn't end until it times out
My app passes all the tests in Circle CI. However, after it passes it just hangs there until it times out at 10...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found