Unit tests are a way to verify that the code you write works as expected. In other Boot.dev courses, you write code that passes the unit tests we provide. As a developer, you'll be expected to write your own tests to ensure that individual pieces of your code, "units", work as expected.
It can feel like a lot of extra work...

...but it's often worth it, especially if the logic you're testing is particularly complex while simultaneously easy to test (e.g. it doesn't rely on external stuff like files or the network). Once you have some good tests, you can run them whenever you make changes to ensure you didn't break anything.
python3 -m unittest discover -s src
This command tells Python to use the standard library's unittest module to run all the tests (discover) it can find in the src directory.
import unittest
from textnode import TextNode, TextType
class TestTextNode(unittest.TestCase):
def test_eq(self):
node = TextNode("This is a text node", TextType.BOLD)
node2 = TextNode("This is a text node", TextType.BOLD)
self.assertEqual(node, node2)
if __name__ == "__main__":
unittest.main()
This test creates two TextNode objects with the same properties and asserts that they are equal. Notice the missing url argument which should have a default value of None. If you run your tests with ./test.sh, you should see that the test passes.
Run and submit the CLI tests.
test_ to be discoverable by unittest.chmod +x test.sh