简体   繁体   中英

Where do we add package.json file

I'm new to tests, especially with JavaScript.

When I write tests in .NET, I create a new project and have all my tests in there. However, it's time to test the JavaScript.

I'm trying to achieve this using Karma and Jasmine. I'm following a tutorial . It states

You'll simply need to right-click on your project and add the NPM Configuration File which creates a package.json file in your project's main folder.

Does this mean I want my tests to be part of my main UI project? I also don't know what it means by my project's main folder...

here is a sample directory structure of a generic application

myprojectDir/<all configuration files> // such as package.json Readme.MD
myprojectDir/node_modules/<all npm dependencies> // these will be installed using npm install command
myprojectDir/app/<you application folder>

You need to initiate a project using npm init command. Here myprojectDir is your main project folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM