I followed the Contribution instructions to get set up for development. When I tried to run yarn test, the unit tests hang for several minutes without any feedback. I do see the Electron icon pop up in my Dock, but I can't open it to see the test status. What am I doing wrong here?
yarn install --frozen-lockfileyarn grunt && yarn icon-genyarn testActual result:
Tests hang on unit tests, i.e. `Running "unit-tests" task'
Expected result:
Tests complete


Signal version:
N/A (cloned directly from repository)
Operating System:
OSX 10.11.6
Linked device version:
N/A
N/A
Edit: After about an hour, I receive this output ten times:
Set Windows Application User Model ID (AUMID) { appUserModelId: 'org.whispersystems.signal-desktop' }
NODE_ENV test
NODE_CONFIG_DIR /Users/derek/git/js/Signal-Desktop/config
NODE_CONFIG {}
ALLOW_CONFIG_MUTATIONS undefined
HOSTNAME undefined
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
userData: /Users/derek/Library/Application Support/Signal-test
config/get: Successfully read user config file
config/get: Did not find ephemeral config file, cache is now empty object
making app single instance
quitting; we are the second instance
Followed by:
Fatal error: Something went wrong: Client initialization failed after 10 attempts: RuntimeError Client initialization failed after 10 attempts: Error: ESOCKETTIMEDOUT
I do not have another instance of Signal running; I ran these tests right from restart, and Signal doesn't start up automatically.
What happens when you run NODE_ENV=test yarn start?
@scottnonnenberg Here's the output:
yarn run v1.9.4
$ electron .
Set Windows Application User Model ID (AUMID) { appUserModelId: 'org.whispersystems.signal-desktop' }
NODE_ENV test
NODE_CONFIG_DIR /Users/derek/git/js/Signal-Desktop/config
NODE_CONFIG {}
ALLOW_CONFIG_MUTATIONS undefined
HOSTNAME undefined
NODE_APP_INSTANCE undefined
SUPPRESS_NO_CONFIG_WARNING undefined
userData: /Users/derek/Library/Application Support/Signal-test
config/get: Successfully read user config file
config/get: Did not find ephemeral config file, cache is now empty object
making app single instance
{"name":"log","hostname":"denali.local","pid":18091,"level":30,"msg":"app ready","time":"2018-09-04T18:11:09.616Z","v":0}
{"name":"log","hostname":"denali.local","pid":18091,"level":50,"msg":"Uncaught error or unhandled promise rejection: Error: SQLITE_NOTADB: file is not a database","time":"2018-09-04T18:11:09.636Z","v":0}
...before it hangs
Delete ~/Library/Application Support/Signal-test and it should work again.
Thanks Scott! That did it.
In my case yarn test always show :

But NODE_ENV=test yarn start show :

@serifreedom You might need to run yarn clean-transpile then yarn grunt and then things will start working again.
@scottnonnenberg-signal command yarn clean-transpile not works

The only way I've tried and works, delete all old test files in throw err path : Error: Cannot find module '../../xxx'
Thanks anyway.
@serifreedom Try rm -rf ./ts then git checkout ts and it should work. The problem you're running into is old, cached js files which were compiled from typescript.
@scottnonnenberg-signal still error:

@serifreedom yarn transpile or yarn grunt and then you should be able to run the tests.
@scottnonnenberg-signal yes! after yarn grunt then yarn test perfectly works!
Thank you so much.
Most helpful comment
@serifreedom
yarn transpileoryarn gruntand then you should be able to run the tests.