Description
Running npm start starts up plotly.js DevTools. If a malformed JSON exists in the mocks folder (test/image/mocks), this process will crash and the dev server won't start. The script should be updated to handle this situation.
Steps to reproduce
- Add an empty JSON file to the mocks folder:
touch test/image/mocks/empty_file.json
- Run
npm start
- Note that the process crashes
$ npm start
> plotly.js@3.3.0 start
> node devtools/test_dashboard/server.mjs
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at file:///home/cam/Development/plotly/plotly.js/devtools/dashboard_utilities.mjs:43:31
at Array.map (<anonymous>)
at createMocksList (file:///home/cam/Development/plotly/plotly.js/devtools/dashboard_utilities.mjs:42:33)
at async file:///home/cam/Development/plotly/plotly.js/devtools/test_dashboard/server.mjs:19:1
Node.js v18.20.8
Description
Running
npm startstarts up plotly.js DevTools. If a malformed JSON exists in the mocks folder (test/image/mocks), this process will crash and the dev server won't start. The script should be updated to handle this situation.Steps to reproduce
npm start