Posts

Discuss the result in Release 0.4

Image
 After preparing for the fourth assignment, I start to code and test my project. I add a command ling flag "-d" to indicate that I will process a directory to test all the files for checking links. In addition, I create a new .js file to encapsulate all the coding about reading a directory.  After completing the code, I start to test my project. But unfortunately it outputs some errors.                                                                        Error message After research and analysis, I realize that there is a problem with the directory path. It can't find the real file in my local host. Then I fix the bug.                                                                        Fix the path bug Then I test my project again. It works well.                                                                   Successful output At last, I create a pull request to the link check repo.

Update the process about Release 0.4

 In the second blog of Release 0.4, I will update my process about my link check project . Until now, my link check project can test status of a single link and the status of all the links of a file. But it can't process a directory to check all the files which include the links. So, I decide to add this feature to my project. I create an issue in the repo of Github. During the studying of Javascript and C++ programming languages, I just know how to read a file. It is a new topic for me. So, I need to search for the resolution for reading a directory. After searching, I find that there are two ways to read a directory using JavaScript. One is "fs.readdir()". The other is "fs.readdirSync()".  The  fs.readdir() method  is used to asynchronously read the contents of a given directory. The callback of this method returns an array of all the file names in the directory. The options argument can be used to change the format in which the files are returned from the me

Choose a project in Release 0.4

 Release 0.4 is my fourth assignment for OSD600 course. There are three steps to complete it. The first step is to choose a project which you will work with. The second step is to update the process about the work. The last step is to show my result for the project. Because it is close to my test week. I don't have enough time to search for a new suitable project. So, I decide to work with the former project in this course. Actually I plan to work with my link checker project . I had designed some features which can be used to test if a link work well. But I think there are still something which I can promote. This is true for every IT project, and you can continually improve the project to make it better and better. In the first assignment for this course, my professor list many optional features which can be designed into the link check project. I will choose one of them which I don't complete to further refine my project.

Publish project in Lab 9

Image
This week we start to practice how to release your project into public. In this way, the users don't need to clone  and build your project to run it locally. They can install it globally and use it easily. In this lab, I utilize my link checker project to practice to release it. Because my project was written by Node.js, so I choose npm platform to create my release.  First of all, I read the npm documents and check my project files step by step. I make sure the package.json file includes everything required such as name, version, dependencies, scripts, author and so on. After modifying all the things, I push these changes into my GitHub. Second, I create an account in npm website . It  is a necessary step if you want to publish your project into npm platform. Then,  I us e the command "npm login" to login the npm platform. After that, I use the command "npm push" to release my project. In the first release operation, there is a 403 error which shows " Yo

The software testing in Lab 8

Image
 This week we start to practice how to test the project with a testing framework. In the lab, I choose Jest to test my link checker project  written by JavaScript.  Jest  is a testing framework developed by Facebook. Originally designed to make UI testing easier for React developers, it’s now a full standalone suite of tools for any type of JavaScript project (including Node.js) and includes features such as a built-in assertion library, code coverage, and mocking. Jest also runs multiple test suites concurrently, which can speed up the overall testing process.  Jest has a lot of advantages, so I want to use it. First of all, I install the Jest to my local project using the command " npm install --save-dev jest ". Then I write three unit tests for reading a file and requesting a url by creating two new .test.js files. After completing the coding, I try to test them using the command "npm run test" and it works well. Unit test Second, I add some scripts in the packa

The second pull request for Release0.3

Image
Telescope is an open source web server and client application for aggregating and presenting a timeline of Seneca's open source blogs.  This week I try to fix an issue in the  Telescope project .  First of all, I setup the Telescope project in my local host. When I look at the "About page", I find that half of that page will be blank if I scroll down the page. It looks  weird. So, I create an issue about the problem.                                                            About page before In order to fix this issue, I create a new <div> tag to wrap the pictures. Then, I set CSS for this tag to make the <div> tag sticky to the top of the page.                                                           Add a new <div> tag After modifying the code, I start to test it locally in my host. It looks well. The pictures keep on the top of the page when I scroll down.                                                            Fixed page At last, I push the com

The first pull request for Release0.3

Image
 For the first pull request of Release0.3, I choose a new project named  react-course-theme  to deal with.  In the project, there is a crash issue when the user input a url to enter the website directly. But it will be fine if the user enter the website through the link of the main page. Error message When I analyze the project, I find the problem comes from using  useLocation ( ) function of " react-router-dom ". W hen  every route is connected, the value can be passed from one page to the next clicked page. But when you want to enter the website directly through URL, the new page can't get the value from the  useLocation ( ) function.                                      Use  useLocation ( ) function to get value from previous page Pass value through history.push() function In order to fix the issue, I choose to parse the URL to get unique ID u sing  useParams () function of " react-router-dom ". Then I fetch the data from source data using find() function.