- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13
Assignment 2
- Student has Github account
- Student has Node JS installed on local laptop
- Continuous Build
- Continuous Integration
- Working with AWS CLI
- Test Driven Development (TDD)
- First browse to this project and hit the Fork button to create your own (writeable) copy of the project: https://github.com/hackoregon/programmingforprogress-frontend.git
- Then click the Clone or download button (at the far right) and then the Copy button to get the URL for the project, so you can clone your copy
- You'll run commands like this (but substituting the URL of your project instead)
$ git clone https://github.com/YOURGITHUBUSERNAME/programmingforprogress-frontend.git- Log in to http://travis-ci.org using your github credentials
- Add your repository
- Activate the repository /programmingforprogress-frontend
Note: if the setup/welcome page doesn't redirect you after five minutes, just browse to your Accounts page (https://travis-ci.org/profile/) to activate the repository
$ sudo gem install travis
$ travis login --auto- Do Steps 1-3 in AWS tutorial to setup bucket policy
- Follow the instructions to create your AWS CLI credentials
Create .travis.yml file and save to project directory
language: node_js
node_js:
- '6.0'
install: npm install
deploy:
  provider: s3
  access_key_id: "${AWS_ACCESS_KEY_ID}"
  secret_access_key: "${AWS_SECRET_ACCESS_KEY}"
  bucket: "<your bucket name>"
  region: us-west-2In the travis-ci.org config for your repo, add the following environment variables with your AWS credentials making sure that your keys are not exposed:
AWS_ACCESS_KEY
AWS_SECRET_KEY
$ git add .
$ git commit . -m "added travis configuration"
$ git push origin masterBrowse to your travis home page (https://travis-ci.org/) and watch the build. It will fail.
Add the following line to your .travis.yml file before the install: line to install the mocha framework
before_install: npm install mocha
From your local command line:
$ npm install mochaEdit package.json file in project directory to this:
"scripts": {
  "test":"mocha",create a stubbed unit test function (yes this test will always pass - i.e. not a recommended pattern for real unit testing):
$ mkdir testin your favorite editor create the file test/test.js with the following:
var assert = require('assert');
describe('Array', function() {
  describe('#indexOf()', function() {
    it('should return -1 when the value is not present', function() {
      assert.equal(-1, [1,2,3].indexOf(4));
    });
  });
});from your command line run:
$ npm testYou should see:
Array
  #indexOf()
    ✓ should return -1 when the value is not present
1 passing (12ms)Commit your changes from the command line
$ git add .
$ git commit . -m "added first test"
$ git push origin masterSwitch to travis page and watch build. It should pass.