Reading 02 - AvreyBrown-401-advanced-javascript/seattle-javascript-401d32 GitHub Wiki
TDD- TDD is an approach to writing software where you write tests before you write application code. The basic steps are:
Red: Write a test and make sure it fails. Green: Write the simplest, easiest possible code to make the test pass. Refactor: Optimise and/or simplify the application code, making sure that all the tests still pass.
The easiest way to specify Node.js versions is to use one or more of the latest releases in your .travis.yml:
node latest stable Node.js release lts/* latest LTS Node.js release
EX. .travis.yml language: node_js node_js:
- 7 to explicitley cache your dependencies- cache: npm
Travis CI detects use of yarn.
If both package.json and yarn.lock are present in the current directory, we run the following command instead of npm install: yarn Note that yarn requires Node.js version 4 or later. If the job does not meet this requirement, npm install is used instead.
Use npm to . . . Adapt packages of code for your apps, or incorporate packages as they are. Download standalone tools you can use right away. Run packages without downloading using npx. Share code with any npm user, anywhere. Restrict code to specific developers. Create Orgs (organizations) to coordinate package maintenance, coding, and developers. Form virtual teams by using Orgs. Manage multiple versions of code and code dependencies. Update applications easily when underlying code is updated. Discover multiple ways to solve the same puzzle. Find other developers who are working on similar problems and projects.
npm supports the “scripts” property of the package.json file, for the following scripts:
prepublish: Run BEFORE the package is packed and published, as well as on local npm install without any arguments. (See below) prepare: Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies (See below). This is run AFTER prepublish, but BEFORE prepublishOnly. prepublishOnly: Run BEFORE the package is prepared and packed, ONLY on npm publish. (See below.) prepack: run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies) postpack: Run AFTER the tarball has been generated and moved to its final destination. publish, postpublish: Run AFTER the package is published. preinstall: Run BEFORE the package is installed install, postinstall: Run AFTER the package is installed. preuninstall, uninstall: Run BEFORE the package is uninstalled. postuninstall: Run AFTER the package is uninstalled. preversion: Run BEFORE bumping the package version. version: Run AFTER bumping the package version, but BEFORE commit. postversion: Run AFTER bumping the package version, and AFTER commit. pretest, test, posttest: Run by the npm test command. prestop, stop, poststop: Run by the npm stop command. prestart, start, poststart: Run by the npm start command. prerestart, restart, postrestart: Run by the npm restart command. Note: npm restart will run the stop and start scripts if no restart script is provided. preshrinkwrap, shrinkwrap, postshrinkwrap: Run by the npm shrinkwrap command.