How to use IntelliJ to integrate nodejs for interface testing <response demo>

1. For the relevant configuration and installation, refer to the following address. The master wrote it well (both mac and windows can be downloaded)

https://www.jianshu.com/p/dd2d2d0ff133 

2. Nodejs is not found when integrating nodejs, follow the steps below to set and install

3. Install nodejs (I use macos here, so download the pkg package)

Method 1: Download and install directly through http://nodejs.cn/download, the steps are default, and the path is optional

Method 2: Through the command (mac as an example)

Homebrew install: ruby ​​-e "$(curl -fsSL  https://raw.githubusercontent.com/Homebrew/install/master/install )" 

Install nodejs: brew install nodejs

Inspection: After the installation is successful, the repeated use method will be prompted to repeat during installation, as shown in the figure:

Check for existence in the system after background installation: you can use the command ($path npm)

4. Configure nodejs on intelliJ

step1:

step2:

step3: configuration parameters

step 4: Run and view the result: found that the path to the js file could not be found

 

 step5: Check and find the cause"

Modify the js file path to an absolute path:

First copy its address:

Enter edit configurations to modify the configuration: save

 

step6: run again and it's ok

 

 

Next: Demo for interface testing using mocha+supertest+nodejs+chai

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325133129&siteId=291194637