/raven

Primary LanguageJavaScript

Raven

Please install the project: npm install

To test it: npm run test

Original problem text:

Here is part of an application that creates a file tree data structure from a JSON input. However, there are one or more bugs in this code.

It seems that for some data sets this code creates an incorrect file tree structure.

Another developer was able to isolate the bug and wrote a test case that simulates the bug. See src/app/app.spec.js for test case details. You can build the project to see which tests are failing

Your job is to find the bug and fix it. The only file that should be changed is src/app/app.js. You can always build the project to see if your solution works.

Good luck!

About the solution:

I uploaded the exact code with the bug from the main branch. if you run the tests on the main branch 2 errors will appear

So i created a branch called fix/bug-data-sort. if you run the tests on this branch no error will appear.

I opened a pull request from the fix/bug-data-sort branch to the main branch where you can see the solution to the problem