Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ languages:
Python: false
exclude_paths:
- "demo/*"
- "server.js"
- "karma.config.js"
- "webpack.config.js"
- "test/*"
- "push-state-tree.js"
- "push-state-tree.min.js"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ npm-debug.log
.grunt
report/
_SpecRunner.html

build/
4 changes: 3 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"boss": true,
"browser": true,
"evil": false,
"esnext": true,
"globals": {
"jQuery": true,
"console": false,
Expand All @@ -36,6 +37,7 @@
"beforeEach": true,
"spyOn": true,
"jasmine": true,
"PushStateTree": true
"PushStateTree": true,
"VERSION": true
}
}
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ node_js:
addons:
code_climate:
repo_token: 418a1b87b0824002644b73e147820942b4259522011e2d14ff65ebdee6542872
before_install: npm install -g grunt-cli
install: npm install
before_script:
- grunt
- npm test
script:
- grunt coveralls
- cat ./build/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
after_script:
- codeclimate < report/coverage/lcov/lcov.info
sudo: false
149 changes: 0 additions & 149 deletions Gruntfile.js

This file was deleted.

1 change: 0 additions & 1 deletion bower.json

This file was deleted.

1 change: 0 additions & 1 deletion component.json

This file was deleted.

95 changes: 88 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,78 @@
'use strict';

const webpackDevServer = require('webpack-dev-server');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config');
const yargs = require('yargs');
const open = require('open');
const path = require('path');

yargs.options({
'watch': {
type: 'boolean',
describe: 'Start a dev-server on port 8080 and karma server on port 9876'
},
'dev-port': {
type: 'numeric',
describe: 'The dev-server port',
default: 8080
},
'open': {
type: 'boolean',
describe: 'Open the default browser'
}
});

let argv = yargs.argv;

if (argv.watch) {
let port = argv['dev-port'] || 8080;

const webpackDevConfig = Object.assign({
cache: true,
devtool: 'hidden-source-map'
}, webpackConfig);

webpackDevConfig.entry['push-state-tree'] = [
webpackConfig.entry['push-state-tree'],
`webpack-dev-server/client?http://localhost:${port}/`
];

var compiler = webpack(webpackDevConfig);
var server = new webpackDevServer(compiler, {
historyApiFallback: true,
quiet: true,
noInfo: true,
inline: true,
stats: { colors: true },
headers: { 'X-SourceMap': '/push-state-tree.js.map' }
});
server.listen(port, err => {
if (err) throw err;

var uri = `http://localhost:${port}/`;
console.log(uri);

console.log(`webpack result is served from ${path.resolve('.')}`);
console.log('404s will fallback to /index.html');

if (argv.open)
open(uri);
});
}

module.exports = function (config) {
config.set({

// base path, that will be used to resolve files and exclude
basePath: '.',

// frameworks to use
frameworks: ['jasmine'],
frameworks: ['mocha', 'chai-spies', 'chai'],

// list of files / patterns to load in the browser
files: [
'src/*.js',
'test/specs/*.js'
'test/**/*.js'
],

// list of files to exclude
Expand All @@ -23,7 +85,26 @@ module.exports = function (config) {
// source files, that you wanna generate coverage for
// do not include tests or libraries
// (these files will be instrumented by Istanbul)
'src/*.js': ['coverage']
'src/pushStateTree.js': ['coverage', 'webpack', 'sourcemap'],
'test/**/*.js': ['webpack', 'sourcemap']
},

webpack: {
module: Object.assign(webpackConfig.module, {
postLoaders: [{
test: /\.js/,
exclude: /(test|node_modules|bower_components)/,
loader: 'istanbul-instrumenter'
}]
}),
plugins: webpackConfig.plugins,
devtool: 'inline-source-map'
},

webpackMiddleware: {
stats: {
colors: true
}
},

coverageReporter: {
Expand All @@ -40,8 +121,8 @@ module.exports = function (config) {
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' },
{ type: 'lcovonly', subdir: '.', file: 'lcov.info' },
{ type: 'teamcity', subdir: '.', file: 'teamcity.txt' },
{ type: 'text', subdir: '.', file: 'text.txt' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' }
{ type: 'text' },
{ type: 'text-summary' }
]
},

Expand All @@ -65,6 +146,6 @@ module.exports = function (config) {

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true
singleRun: !argv.watch
});
};
Loading