Skip to content

Commit 83e0df0

Browse files
authored
Merge pull request #10 from linux-nerd/feature/configure-travis-ci
Added travisCI configuration
2 parents 66eb0ae + fe87681 commit 83e0df0

File tree

5 files changed

+57
-6
lines changed

5 files changed

+57
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
lib/

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
language: node_js
2+
sudo: false
3+
# force trusty as Google Chrome addon is not supported on Precise
4+
dist: trusty
5+
node_js:
6+
- "6.9.1"
7+
addons:
8+
apt:
9+
sources:
10+
- google-chrome
11+
packages:
12+
- google-chrome-stable
13+
# firefox: "38.0"
14+
#apt:
15+
#sources:
16+
# needed to install g++ that is used by npms's native modules
17+
#- ubuntu-toolchain-r-test
18+
#packages:
19+
# needed to install g++ that is used by npms's native modules
20+
#- g++-4.8
21+
# https://docs.travis-ci.com/user/jwt
22+
#jwt:
23+
# SAUCE_ACCESS_KEY<=secret for NGBUILDS_IO_KEY to work around travis-ci/travis-ci#7223, unencrypted value in valentine as NGBUILDS_IO_KEY>
24+
# we alias NGBUILDS_IO_KEY to $SAUCE_ACCESS_KEY in env.sh and set the SAUCE_ACCESS_KEY there
25+
#- secure: "L7nrZwkAtFtYrP2DykPXgZvEKjkv0J/TwQ/r2QGxFTaBq4VZn+2Dw0YS7uCxoMqYzDwH0aAOqxoutibVpk8Z/16nE3tNmU5RzltMd6Xmt3qU2f/JDQLMo6PSlBodnjOUsDHJgmtrcbjhqrx/znA237BkNUu6UZRT7mxhXIZpn0U="
26+
cache:
27+
directories:
28+
- ./node_modules
29+
- ./.chrome/chromium
30+
install:
31+
- npm install
32+
script:
33+
- npm run test:travis
34+
# Excluding build process as of now
35+
#- npm run build

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
Data Structures in Javascript
55
-----------------------------
6+
![Build Status](https://travis-ci.org/linux-nerd/data-structures.js.svg?branch=master)
67

78
# Background
89
There are neither a lot of resources on internet nor any book which guides and dictates best practices in the implementation of popular Data Structures using Javascript. The purpose of this library is to provide cooked implementation of populare data structures in javascript.

karma.conf.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
// Generated on Mon Oct 02 2017 21:15:08 GMT+0530 (India Standard Time)
33
var webpackConfig = require('./webpack.config.js');
44

5+
6+
57
module.exports = function (config) {
6-
config.set({
8+
9+
var configuration = {
710

811
// base path that will be used to resolve all patterns (eg. files, exclude)
912
basePath: '',
@@ -16,6 +19,7 @@ module.exports = function (config) {
1619

1720
// list of files / patterns to load in the browser
1821
files: [
22+
'node_modules/babel-polyfill/dist/polyfill.js',
1923
'src/**/*.spec.js'
2024
],
2125

@@ -60,11 +64,18 @@ module.exports = function (config) {
6064

6165
// start these browsers
6266
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
63-
browsers: ['Chrome'],
67+
browsers: ['Chrome', 'PhantomJS'],
6468

6569

6670
// Continuous Integration mode
6771
// if true, Karma captures browsers, runs the tests and exits
6872
singleRun: false
69-
})
70-
}
73+
};
74+
75+
//workaround for travis
76+
if (process.env.TRAVIS) {
77+
configuration.browsers = ['PhantomJS'];
78+
}
79+
80+
config.set(configuration);
81+
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"build": "SET WEBPACK_ENV=build && webpack",
88
"dev": "SET WEBPACK_ENV=dev & webpack --progress --colors --watch",
9-
"test": "SET WEBPACK_ENV=dev & karma start"
9+
"test": "SET WEBPACK_ENV=dev & karma start",
10+
"test:travis": "SET WEBPACK_ENV=dev & karma start --single-run"
1011
},
1112
"keywords": [],
1213
"author": "",
@@ -17,13 +18,15 @@
1718
"babel-eslint": "8.0.1",
1819
"babel-loader": "^6.1.0",
1920
"babel-plugin-add-module-exports": "0.1.2",
21+
"babel-polyfill": "^6.26.0",
2022
"babel-preset-latest": "^6.24.1",
2123
"eslint": "1.7.2",
2224
"eslint-loader": "1.1.0",
2325
"jasmine-core": "^2.8.0",
2426
"karma": "^1.7.1",
2527
"karma-chrome-launcher": "^2.2.0",
2628
"karma-jasmine": "^1.1.0",
29+
"karma-phantomjs-launcher": "^1.0.4",
2730
"karma-webpack": "^2.0.4",
2831
"phantomjs-prebuilt": "^2.1.15",
2932
"tslint": "^5.7.0",

0 commit comments

Comments
 (0)