Giter VIP home page Giter VIP logo

from-zero-to-hero's Introduction

"From Zero to Hero" Example

This is a slightly modified Todo MVC sample app using React (initially created by @petehunt):

To run the app:

npm install
npm start

and then open a web browser pointing to http://localhost:9000.

Git Hooks

Create a simple pre-commit hook:

cat << EOF >> .git/hooks/pre-commit
npm run jscs
EOF

and make it executable:

chmod +x .git/hooks/pre-commit

Now try to edit a file, e.g. js/util.js, and violate its coding style. When you try to commit your change, Git will complain.

Code Complexity

Show the summary of code complexity (using JSComplexity):

npm run complexity

Code Coverage

Run the unit tests and track the code coverage:

npm run coverage

and open the file coverage/html/index.html for the coverage report.

For this repository, it is also tracked at codecov.io/github/ariya/from-zero-to-hero.

Evergreen Browser Tests

The unit tests are being executed with the latest Chrome and Firefox using AppVeyor (read more).

The example run is available at ci.appveyor.com/project/ariya/from-zero-to-hero.

Browser Compatibility Tests

The unit tests are being executed with a number of different web browsers using Sauce Labs.

Assuming that the username and access key are stored in the environment variable SAUCE_USERNAME and SAUCE_ACCESS_KEY, Sauce Connect can be initiated as follow (on Linux):

wget -q https://saucelabs.com/downloads/sc-4.3.11-linux.tar.gz
tar -xzf sc-4.3.11-linux.tar.gz
export PATH=$PATH:`pwd`/sc-4.3.11-linux/bin
sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY -f ~/sc_ready &
sleep 25
while [ ! -e ~/sc_ready ]; do sleep 5; done

and then run the tests with a special Karma configuration:

npm run saucelabs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.