Skip to content

fredbouchard/ng-contacts

 
 

Repository files navigation

About this Project

This project is a little sample of a Contacts Manager running in a single page app. Its approach is component based for scalability. All the part I've coded are under the /client folder. The rest of the credits goes to the following below

Getting Started

Dependencies

Tools needed to run this app:

  • node and npm
  • This project has been tested with node 6.0.7.

Installing

  • npm install to install dependencies

Running the App

  • Simply run in a terminal the following command `gulp'

This projects uses Gulp to build and launch the development environment. After you have installed all dependencies, you may run the app. Running npm start will bundle the app with webpack, launch a development server, and watch all files. The port will be displayed in the terminal.

Tasks

Here's a list of available tasks:

  • npm run build
    • runs Webpack, which will transpile, concatenate, and compress (collectively, "bundle") all assets and modules into dist/bundle.js. It also prepares index.html to be used as application entry point, links assets and created dist version of our application.
  • npm run serve
    • starts a dev server via webpack-dev-server, serving the client folder.
  • npm run watch
    • alias of serve
  • npm start (which is the default task that runs when typing gulp without providing an argument)
    • runs serve.

Testing Setup

All tests are also written in ES6. We use Webpack to take care of the logistics of getting those files to run in the various browsers, just like with our client files. This is our testing stack:

  • Karma
  • Webpack + Babel
  • Mocha
  • Chai

To run tests, type npm test in the terminal. Read more about testing below.

Testing

To run the tests, run npm test.

Karma combined with Webpack runs all files matching *.spec.js inside the app folder. This allows us to keep test files local to the component--which keeps us in good faith with continuing to build our app modularly. The file spec.bundle.js is the bundle file for all our spec files that Karma will run.

Be sure to define your *.spec.js files within their corresponding component directory. You must name the spec file like so, [name].spec.js. If you don't want to use the .spec.js suffix, you must change the regex in spec.bundle.js to look for whatever file(s) you want. Mocha is the testing suite and Chai is the assertion library. If you would like to change this, see karma.conf.js.

Credits

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.0%
  • HTML 19.7%
  • CSS 10.3%