Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for One of the most difficult lab..
jsong89
jsong89

Posted on

     

One of the most difficult lab..

Github Repo:Project
Commit log:Commit-log

Start..

This lab 8 was to implement tests to apply to the static-site generator in progress in class. In fact, I've heard of this part before, so I chose JEST, a test framework I've heard of before. The framework can test only the part you want, and you can also try running it for each internal test code (npm run is not required!!!).

Processing

Below is what I did to use JEST.
First, I downloaded jest using npm.

npm i -D jest
Enter fullscreen modeExit fullscreen mode

After the download is complete, I put the following test run command in thepackage.json file.

"test": "jest","test:cover": "jest --coverage",
Enter fullscreen modeExit fullscreen mode

Lastly, for the files that need testing, I created atest folder and created a test code in ~.test.js under it.

Howevver..

It was easy up to this point, but the problem was that the linkage of each code of my static site generator was too high ( ex:) Even if I wanted to test only A, it was impossible to test only A because B and C were connected.) I've spent a lot of time trying to. But, unfortunately, it was a problem that could not be solved within a limited time because the part had to be repaired from the bottom up...

There are many problems, but one of them is this.
Image description

As a result, I decided stop working for this until now. But, I will update and fixing step by step later :)
It was really competitive and sometimes disappointed for mem but I believe these all things will be an asset for me.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Location
    Toronto, Ontario
  • Joined

More fromjsong89

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp