Page MenuHomePhabricator

[Cashtab] ts jest woes
AbandonedPublicDraft

Authored by bytesofman on Mon, Nov 4, 19:43.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

nightmare implementing ts for test files in Cashtab. Needs more attention but for now just use js.

Test Plan

Will abandon this

Diff Detail

Event Timeline

Tail of the build log:

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.1.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.

added 1634 packages, and audited 1640 packages in 17s

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

1 low severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> cashtab@2.52.1 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Error: /work/cashtab/src/index.js: 'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods and @babel/plugin-transform-private-property-in-object (when they are enabled).
If you already set the same 'loose' mode for these plugins in your config, it's possible that they are enabled multiple times with different options.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded configuration:
	npx cross-env BABEL_SHOW_CONFIG_FOR=/work/cashtab/src/index.js <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
    at transformFile.next (<anonymous>)
    at run.next (<anonymous>)
    at transform.next (<anonymous>)


Build cashtab-tests failed with exit code 1

Failed tests logs:

====== alias-server alias.js: "before all" hook for "parseAliasTx returns tx info for an alias tx with an overpaid fee".alias-server alias.js "before all" hook for "parseAliasTx returns tx info for an alias tx with an overpaid fee" ======
Error: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:382:62)
    at MongoInstance.stderrHandler (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:304:14)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
====== alias-server alias.js: "after all" hook for "parseTxForPendingAliases adds multiple pending alias registrations to the database if an incoming tx containing multiple alias registrations comes in".alias-server alias.js "after all" hook for "parseTxForPendingAliases adds multiple pending alias registrations to the database if an incoming tx containing multiple alias registrations comes in" ======
TypeError: Cannot read properties of undefined (reading 'close')
    at Context.<anonymous> (test/alias.test.js:44:31)
    at process.processImmediate (node:internal/timers:483:21)
====== alias-server app.js: "before all" hook for "/prices returns aliasConstants.prices".alias-server app.js "before all" hook for "/prices returns aliasConstants.prices" ======
Error: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:382:62)
    at MongoInstance.stderrHandler (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:304:14)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
====== alias-server app.js: "after all" hook for "/address/:address returns an error on database error".alias-server app.js "after all" hook for "/address/:address returns an error on database error" ======
TypeError: Cannot read properties of undefined (reading 'close')
    at Context.<anonymous> (test/app.test.js:29:31)
    at process.processImmediate (node:internal/timers:483:21)
====== alias-server chronikWsHandler.js: "before all" hook for "initializeWebsocket returns expected websocket object for a p2pkh address".alias-server chronikWsHandler.js "before all" hook for "initializeWebsocket returns expected websocket object for a p2pkh address" ======
Error: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:382:62)
    at MongoInstance.stderrHandler (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:304:14)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
====== alias-server chronikWsHandler.js: "after all" hook for "parseWebsocketMessage removes a txid from pendingAliases if TX_REMOVED_FROM_MEMPOOL message includes that txid".alias-server chronikWsHandler.js "after all" hook for "parseWebsocketMessage removes a txid from pendingAliases if TX_REMOVED_FROM_MEMPOOL message includes that txid" ======
TypeError: Cannot read properties of undefined (reading 'close')
    at Context.<anonymous> (test/chronikWsHandler.test.js:38:31)
    at process.processImmediate (node:internal/timers:483:21)
====== alias-server db.js: "before all" hook for "initializeDb returns a mongo db instance of the expected schema".alias-server db.js "before all" hook for "initializeDb returns a mongo db instance of the expected schema" ======
Error: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:382:62)
    at MongoInstance.stderrHandler (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:304:14)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
====== alias-server db.js: "after all" hook for "getPendingAliases returns only pending aliases with specified address and without tipHeight, if called with { _tipHeight: 0 } projection".alias-server db.js "after all" hook for "getPendingAliases returns only pending aliases with specified address and without tipHeight, if called with { _tipHeight: 0 } projection" ======
TypeError: Cannot read properties of undefined (reading 'close')
    at Context.<anonymous> (test/db.test.js:37:31)
    at process.processImmediate (node:internal/timers:483:21)
====== alias-server events.js: "before all" hook for "handleAppStartup calls handleBlockFinalized with tipHeight and completes function if block is avalanche finalized, and also removes pendingAliases that are in the avalanche confirmed block".alias-server events.js "before all" hook for "handleAppStartup calls handleBlockFinalized with tipHeight and completes function if block is avalanche finalized, and also removes pendingAliases that are in the avalanche confirmed block" ======
Error: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:382:62)
    at MongoInstance.stderrHandler (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:304:14)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
====== alias-server events.js: "after all" hook for "handleAddedToMempool calls parseTxForPendingAliases if no chronik error".alias-server events.js "after all" hook for "handleAddedToMempool calls parseTxForPendingAliases if no chronik error" ======
TypeError: Cannot read properties of undefined (reading 'close')
    at Context.<anonymous> (test/events.test.js:40:31)
    at process.processImmediate (node:internal/timers:483:21)
====== alias-server main.js: "before all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly".alias-server main.js "before all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly" ======
Error: Instance failed to start because a library is missing or cannot be opened: "libcrypto.so.1.1"
    at MongoInstance.checkErrorInLine (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:382:62)
    at MongoInstance.stderrHandler (node_modules/mongodb-memory-server-core/lib/util/MongoInstance.js:304:14)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:191:23)
====== alias-server main.js: "after all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly".alias-server main.js "after all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly" ======
TypeError: Cannot read properties of undefined (reading 'close')
    at Context.<anonymous> (test/main.test.js:55:31)
    at process.processImmediate (node:internal/timers:483:21)

Each failure log is accessible here:
alias-server alias.js: "before all" hook for "parseAliasTx returns tx info for an alias tx with an overpaid fee".alias-server alias.js "before all" hook for "parseAliasTx returns tx info for an alias tx with an overpaid fee"
alias-server alias.js: "after all" hook for "parseTxForPendingAliases adds multiple pending alias registrations to the database if an incoming tx containing multiple alias registrations comes in".alias-server alias.js "after all" hook for "parseTxForPendingAliases adds multiple pending alias registrations to the database if an incoming tx containing multiple alias registrations comes in"
alias-server app.js: "before all" hook for "/prices returns aliasConstants.prices".alias-server app.js "before all" hook for "/prices returns aliasConstants.prices"
alias-server app.js: "after all" hook for "/address/:address returns an error on database error".alias-server app.js "after all" hook for "/address/:address returns an error on database error"
alias-server chronikWsHandler.js: "before all" hook for "initializeWebsocket returns expected websocket object for a p2pkh address".alias-server chronikWsHandler.js "before all" hook for "initializeWebsocket returns expected websocket object for a p2pkh address"
alias-server chronikWsHandler.js: "after all" hook for "parseWebsocketMessage removes a txid from pendingAliases if TX_REMOVED_FROM_MEMPOOL message includes that txid".alias-server chronikWsHandler.js "after all" hook for "parseWebsocketMessage removes a txid from pendingAliases if TX_REMOVED_FROM_MEMPOOL message includes that txid"
alias-server db.js: "before all" hook for "initializeDb returns a mongo db instance of the expected schema".alias-server db.js "before all" hook for "initializeDb returns a mongo db instance of the expected schema"
alias-server db.js: "after all" hook for "getPendingAliases returns only pending aliases with specified address and without tipHeight, if called with { _tipHeight: 0 } projection".alias-server db.js "after all" hook for "getPendingAliases returns only pending aliases with specified address and without tipHeight, if called with { _tipHeight: 0 } projection"
alias-server events.js: "before all" hook for "handleAppStartup calls handleBlockFinalized with tipHeight and completes function if block is avalanche finalized, and also removes pendingAliases that are in the avalanche confirmed block".alias-server events.js "before all" hook for "handleAppStartup calls handleBlockFinalized with tipHeight and completes function if block is avalanche finalized, and also removes pendingAliases that are in the avalanche confirmed block"
alias-server events.js: "after all" hook for "handleAddedToMempool calls parseTxForPendingAliases if no chronik error".alias-server events.js "after all" hook for "handleAddedToMempool calls parseTxForPendingAliases if no chronik error"
alias-server main.js: "before all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly".alias-server main.js "before all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly"
alias-server main.js: "after all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly".alias-server main.js "after all" hook for "main() connects to a websocket, and runs handleAppStartup() correctly"