Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Merge a231c2a into 674b3a5
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Segreto committed Oct 8, 2015
2 parents 674b3a5 + a231c2a commit 2f80a00
Show file tree
Hide file tree
Showing 69 changed files with 1,523 additions and 4,798 deletions.
20 changes: 20 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
},
"settings": {
"ecmascript": 6,
"jsx": true
},
"plugins": [
"react"
],
"rules": {
"strict": 0,
"quotes": [2, "single"],
"camelcase": 0,
"no-underscore-dangle": 0
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverage
.godeps/
Godeps/_workspace/
cf-deck
static/assets
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,47 @@ Install front end dependencies
```
npm install
```

Build the code:
```
npm run build
```
or to continually watch and build with changes:
```
npm run watch
```

To run the tests:
```
npm run test
```
or to continually watch and test when theres changes:
```
npm run watch-test
```

To lint the code:
```
npm run lint
```

In order to get correct synatax highlighting with vim, install the following
npm modules globally:

```
npm install -g eslint
npm install -g babel-eslint
npm install -g eslint-plugin-react
```

## Running locally
- Make sure all of your environment variables are set as mentioned above.
- Install [godep](https://github.com/tools/godep)
- Run `godep restore` to get all third party code
- `go run server.go`
- Navigate browser to `http://localhost:9999`


## Unit Testing
### Running Go unit tests
- `go test ./...`
Expand Down
28 changes: 0 additions & 28 deletions bower.json

This file was deleted.

93 changes: 29 additions & 64 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,84 +1,49 @@
// Karma configuration
// Generated on Mon Jul 27 2015 12:17:38 GMT-0400 (EDT)

var webpackConfig = require('./webpack.config');

module.exports = function(config) {
config.set({
browsers: ['PhantomJS', 'Chrome'],

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'static/bower_components/angularjs/angular.js',
'static/bower_components/angular-route/angular-route.js',
'static/bower_components/angular-mocks/angular-mocks.js',
'static/bower_components/ladda/dist/spin.min.js',
'static/bower_components/ladda/dist/ladda.min.js',
'static/bower_components/angular-ladda/dist/angular-ladda.min.js',
'static/bower_components/angular-sanitize/angular-sanitize.js',
'static/bower_components/angular-bootstrap-confirm/src/ui-bootstrap-position.js',
'static/bower_components/angular-bootstrap-confirm/dist/angular-bootstrap-confirm.min.js',
'static/bower_components/angular-toggle-switch/angular-toggle-switch.min.js',
'static/app/main.js',
'static/app/filters.js',
'static/app/cloudfoundry.js',
'static/app/controllers.js',
'static/tests/*.js'
],


// list of files to exclude
exclude: [],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'static/app/*': ['coverage']
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],

// web server port
port: 9876,
frameworks: ['jasmine', 'jasmine-matchers', 'sinon', 'phantomjs-shim'],

files: [ './static_src/tests.bundle.js' ],

// enable / disable colors in the output (reporters and logs)
colors: true,
exclude: [],

plugins: [
'karma-chrome-launcher',
'karma-jasmine',
'karma-jasmine-matchers',
'karma-phantomjs-launcher',
'karma-phantomjs-shim',
'karma-sinon',
'karma-sourcemap-loader',
'karma-webpack',
],

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
preprocessors: {
'static_src/tests.bundle.js': [ 'webpack']
},

webpack: webpackConfig,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
reporters: ['progress'],

port: 9876,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
colors: true,

logLevel: config.LOG_INFO,

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
autoWatch: true,

coverageReporter: {
type: 'json',
dir: 'coverage',
subdir: '.'
}
singleRun: false,

phantomjsLauncher: {
exitOnResourceError: true
}
})
}
65 changes: 52 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,63 @@
"description": "test suite",
"main": "null",
"scripts": {
"build": "npm run clean && webpack",
"codecov": "cat ./coverage/coverage-final.json | ./node_modules/codecov.io/bin/codecov.io.js",
"postinstall": "./node_modules/bower/bin/bower install",
"tests": "./node_modules/.bin/karma start karma.conf.js --single-run",
"test": "npm run tests && npm run codecov"
"clean": "rm -rf ./static/assets/*",
"lint": "eslint -c .eslintrc ./static_src",
"test": "npm run lint && karma start --single-run --browsers PhantomJS",
"watch-test": "karma start --browsers Chrome",
"watch": "watch 'npm run build' ./static_src"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^5.8.22",
"bower": "^1.4.1",
"devDependencies": {
"babel-core": "^5.5.4",
"babel-eslint": "^4.1.3",
"babel-loader": "^5.1.4",
"babel-runtime": "^5.5.4",
"codecov.io": "^0.1.5",
"css-loader": "^0.14.4",
"cssnext-loader": "^1.0.1",
"eslint": "^1.6.0",
"eslint-plugin-react": "^3.5.1",
"extract-text-webpack-plugin": "^0.8.1",
"istanbul": "^0.3.5",
"jasmine": "^2.1.1",
"jasmine-core": "^2.1.3",
"jasmine-node": "^1.14.5",
"karma": "^0.12.31",
"karma-coverage": "^0.2.7",
"karma-jasmine": "^0.3.5",
"karma-phantomjs-launcher": "^0.1.4"
"jasmine-core": "^2.3.4",
"jasmine-sinon": "^0.4.0",
"jsx-loader": "^0.13.2",
"karma": "^0.13.8",
"karma-chrome-launcher": "^0.2.0",
"karma-jasmine": "^0.2.2",
"karma-jasmine-matchers": "^0.1.3",
"karma-phantomjs-launcher": "^0.2.1",
"karma-phantomjs-shim": "^1.0.0",
"karma-sinon": "^1.0.4",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"node-libs-browser": "^0.5.2",
"phantomjs": "^1.9.18",
"react-hot-loader": "^1.2.7",
"react-jasmine-matchers": "^2.0.0",
"style-loader": "^0.12.3",
"watch": "^0.16.0",
"webpack": "^1.9.10"
},
"dependencies": {
"axios": "^0.5.4",
"bootstrap": "^3.3.5",
"classnames": "^2.1.5",
"director": "^1.2.8",
"events": "^1.0.2",
"exports-loader": "^0.6.2",
"file-loader": "^0.8.4",
"flux": "^2.0.3",
"imports-loader": "^0.6.4",
"keymirror": "^0.1.1",
"less": "^2.5.3",
"less-loader": "^2.2.1",
"normalize.css": "^3.0.3",
"react": "^0.13.3",
"url-loader": "^0.5.6"
}
}
Loading

0 comments on commit 2f80a00

Please sign in to comment.