Problems with developer setup for mattermost-webapp

Summary

After following developer setup for webapp, make test in point 6 fails:
Makefile:27: recipe for target 'test' failed

Steps to reproduce

I’m using ubuntu 18.04
Follow step by step developer setup mentioned above.

Expected behavior

Setup is completed without any issues.

Observed behavior

Some of the tests fail. By now one issue remained:

Logging output:
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘test’ ]
2 info using npm@6.13.0
3 info using node@v12.13.0
4 verbose run-script [ ‘pretest’, ‘test’, ‘posttest’ ]
5 info lifecycle mattermost-webapp@0.0.1~pretest: mattermost-webapp@0.0.1
6 info lifecycle mattermost-webapp@0.0.1~test: mattermost-webapp@0.0.1
7 verbose lifecycle mattermost-webapp@0.0.1~test: unsafe-perm in lifecycle true
8 verbose lifecycle mattermost-webapp@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/arka204/go/src/github.com/mattermost/mattermost-webapp/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/arka204/go/bin:/usr/local/go/bin
9 verbose lifecycle mattermost-webapp@0.0.1~test: CWD: /home/arka204/go/src/github.com/mattermost/mattermost-webapp
10 silly lifecycle mattermost-webapp@0.0.1~test: Args: [ ‘-c’, ‘jest --forceExit --detectOpenHandles’ ]
11 silly lifecycle mattermost-webapp@0.0.1~test: Returned: code: 1 signal: null
12 info lifecycle mattermost-webapp@0.0.1~test: Failed to exec test script
13 verbose stack Error: mattermost-webapp@0.0.1 test: jest --forceExit --detectOpenHandles
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid mattermost-webapp@0.0.1
15 verbose cwd /home/arka204/go/src/github.com/mattermost/mattermost-webapp
16 verbose Linux 5.0.0-32-generic
17 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “test”
18 verbose node v12.13.0
19 verbose npm v6.13.0
20 error code ELIFECYCLE
21 error errno 1
22 error mattermost-webapp@0.0.1 test: jest --forceExit --detectOpenHandles
22 error Exit status 1
23 error Failed at the mattermost-webapp@0.0.1 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Suggestions
In the beginning there were much more failing tests, but most of them started working after reinstalling npm, so I thought it would be good idea to add this information to developer setup, since I looked around the internet a bit and I don’t think I’m the only one who encountered such problem.

After this two test suites were failing, one of them was solved by installing yarn and running:
sudo yarn add --dev babel-jest babel-core regenerator-runtime (github)
From what I have found you can remove sudo from command if you install yarn using sudo.

I hope it proves to be helpful and that someone will be able to help me.

Problem solved.
After redoing everything from the beginning, this time using nvm to install node (I don’t know if it made any difference) and after being left with one failing test typing:
npm audit fix
solved the problem with the snapshot.