joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Importing from query-not into tests/network-test bug

Open zeeshanakram3 opened this issue 2 years ago • 0 comments

Defining some constant/data such as export const PERBILL_ONE_PERCENT = 10_000_000 in query-node/mappings/src/common.ts or query-node/mappings/src/content/utils.ts, and then importing it in tests/network-tests results in following error while running tests using ./query-node/run-tests.sh

$ ./run-test-scenario.sh content-directory
$ node -r ts-node/register --unhandled-rejections=strict src/scenarios/content-directory.ts
Error: Config: WARTHOG_APP_HOST is required: undefined

However, there is no such error if we define our const in some new file query-node/mappings/src/temporaryConstants.ts with only the definition. Hence, this temporary solution is used in #3452 to import PERBILL_ONE_PERCENT in tests/network-tests/src/Api.ts

A possible reason for the error as suggested by @ondratra is likely that something inside of common.ts(it's also imported by utils.ts) is imported with an unexpected side effect that creates the error.

zeeshanakram3 avatar Mar 22 '22 12:03 zeeshanakram3