Skip to content

Commit 338611e

Browse files
committed
feat(build): add Travis CI build
1 parent 98cb1a0 commit 338611e

File tree

6 files changed

+30
-4
lines changed

6 files changed

+30
-4
lines changed

.travis-deploy.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# go to the out directory and create a *new* Git repo
2+
cd build
3+
git init
4+
5+
# inside this git repo we'll pretend to be a new user
6+
git config user.name "Travis CI"
7+
git config user.email "tomas.trajan@gmail.com"
8+
9+
# The first and only commit to this new Git repo contains all the
10+
# files present with the commit message "Deploy to GitHub Pages".
11+
git add .
12+
git commit -m "Deploy to GitHub Pages"
13+
14+
# Force push from the current repo's master branch to the remote
15+
# repo's gh-pages branch. (All previous history on the gh-pages branch
16+
# will be lost, since we are overwriting it.) We redirect any output to
17+
# /dev/null to hide any sensitive credential data that might otherwise be exposed.
18+
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
node_js:
3+
- "4.1"
4+
script:
5+
- npm run ci
6+
- bash ./.travis-deploy.sh

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Angular JS ES6 Module Testing Example
2+
[![Build Status](https://travis-ci.org/tomastrajan/angular-js-es6-testing-example.svg?branch=master)](https://travis-ci.org/tomastrajan/angular-js-es6-testing-example)
23

34
* original blog post describing [Proper testing of Angular JS 1.X applications with ES6 modules](https://medium.com/@tomastrajan/proper-testing-of-angular-js-applications-with-es6-modules-8cf31113873f)
45
* [demo project](http://tomastrajan.github.io/angular-js-es6-testing-example/) with examples of mocha unit & karma integration tests

karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ module.exports = function(config) {
77
reporters: ['mocha'],
88

99
logLevel: config.LOG_INFO,
10-
autoWatch: true,
11-
singleRun: false,
10+
autoWatch: false,
11+
singleRun: true,
1212
colors: true,
1313
port: 9876,
1414

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"server_build": "node server.js",
1111
"server_dist": "node server.js --TARGET=DIST",
1212
"test": "mocha --compilers js:babel-register ./src/**/*.test.js",
13-
"karma": "karma start"
13+
"karma": "karma start",
14+
"ci": "npm run test && npm run karma && npm run dist"
1415
},
1516
"author": "tomas.trajan@gmail.com",
1617
"license": "ISC",

webpack.karma.context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import angular from 'angular';
22
import mocks from 'angular-mocks';
33

4-
import main from './src/main';
4+
import * as main from './src/main';
55

66
let context = require.context('./src', true, /\.spec\.js/);
77
context.keys().forEach(context);

0 commit comments

Comments
 (0)