So now we have a guitar file that just gets the HTML.
We just wrote that now and we got the HTML.
And now we need to build out our parser, which is getting the actual data from this HTML.
A nice side effect about having this test driven development is that you get a separation of concerns
in your code.
So all you get, you're more likely to have separation of concerns because you need to test one thing
at a time.
So here we have now only a getter for the HTML, which is just getting the HTML.
And then we are also having a parser instead of having it all inside one file.
And for maintainability and readability, this is actually a pretty good thing.
So that's one of the advantages of having test driven development.
Now on to what you guys are here to see, which is to write the test for the parser.
So first we have a before all function that you can use inside of chest, which is going to be run before
it runs all the test.
So in here you can declare variables that you want to use inside all of the tests, such as a HTML variable
you might want to save.
So we can say let HTML, just declare the variable up in the global scope up here and then we can say
HTML equals and then we need to import FS to read a file.
So then we can say FS read file sync and then passed in the test dot HTML file path here.
And then we have a nice big string basically inside of HTML, which is exactly what we can use inside
of Mario or inside our passengers.
So now we have the now it says test not found.
So maybe just with dot test.
It seems to work now.
So let's go into yarn run test, see how our test is running.
We still have our Add two plus two test, which is running, but now we need to write out another test
for the HTML.