Skip to content

Commit

Permalink
Merge pull request #17 from yudhasetiawan/master
Browse files Browse the repository at this point in the history
fix(config): File dependencies order to work with karma: ^1.0
  • Loading branch information
taras42 authored Jul 23, 2016
2 parents a667ce3 + 376de33 commit b744c17
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 31 deletions.
111 changes: 85 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# =========================
# Operating System Files
# =========================

# OSX
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# Linux
# =========================
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon
Icon

# Thumbnails
._*
Expand All @@ -38,6 +54,49 @@ Icon
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
"Network Trash Folder"
"Temporary Items"
.apdisk

# Node
# =========================

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"author": "",
"dependencies": {
"karma-jasmine": "~0.2"
"karma-jasmine": "^1.0.2"
},
"peerDependencies": {
"karma": ">=0.9"
Expand Down
16 changes: 12 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
var JASMINE_CORE_PATTERN = /(\/karma-jasmine\/)/i;
var createPattern = function(path) {
return {pattern: path, included: true, served: true, watched: false};
};

var initReporter = function(files, baseReporterDecorator) {
var jasmineCoreIndex = 0;

baseReporterDecorator(this);

files.unshift(createPattern(__dirname + '/lib/adapter.js'));
files.unshift(createPattern(__dirname + '/lib/html.jasmine.reporter.js'));
files.unshift(createPattern(__dirname + '/css/jasmine.css'));
files.forEach(function(file, index) {
if (JASMINE_CORE_PATTERN.test(file.pattern)) {
jasmineCoreIndex = index;
}
});

files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/css/jasmine.css'));
files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/lib/html.jasmine.reporter.js'));
files.splice(++jasmineCoreIndex, 0, createPattern(__dirname + '/lib/adapter.js'));
};

initReporter.$inject = ['config.files', 'baseReporterDecorator'];

module.exports = {
'reporter:kjhtml': ['type', initReporter]
};
};

0 comments on commit b744c17

Please sign in to comment.