Skip to content

Commit

Permalink
chore: Code cleanup and linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jul 8, 2015
1 parent 7e37a23 commit 48e3000
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 116 deletions.
113 changes: 0 additions & 113 deletions Gruntfile.coffee

This file was deleted.

1 change: 0 additions & 1 deletion client/karma.js
Expand Up @@ -2,7 +2,6 @@ var stringify = require('./stringify')
var constant = require('./constants')
var util = require('./util')

/* jshint unused: false */
var Karma = function (socket, iframe, opener, navigator, location) {
var hasError = false
var startEmitted = false
Expand Down
143 changes: 143 additions & 0 deletions gruntfile.js
@@ -0,0 +1,143 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkgFile: 'package.json',
files: {
server: ['lib/**/*.js'],
client: ['client/**/*.js'],
grunt: ['grunt.js', 'tasks/*.js'],
scripts: ['scripts/init-dev-env.js']
},
browserify: {
client: {
files: {
'static/karma.js': ['client/main.js']
}
}
},
test: {
unit: 'mochaTest:unit',
client: 'test/client/karma.conf.js',
e2e: 'cucumberjs:ci'
},
watch: {
client: {
files: '<%= files.client %>',
tasks: 'browserify:client'
}
},
mochaTest: {
options: {
ui: 'bdd',
reporter: 'dot',
quite: false,
colors: true
},
unit: {
src: [
'test/unit/mocha-globals.coffee',
'test/unit/**/*.coffee'
]
}
},
cucumberjs: {
options: {
steps: 'test/e2e/steps',
format: 'progress'
},
all: 'test/e2e/*.feature',
current: {
files: {
src: 'test/e2e/*.feature'
},
options: {
tags: '@current'
}
},
ci: {
files: {
src: 'test/e2e/*.feature'
},
options: {
tags: '~@not-jenkins'
}
}
},
eslint: {
target: [
'<%= files.server %>',
'<%= files.grunt %>',
'<%= files.scripts %>',
'<%= files.client %>',
'test/**/*.js'
]
},
coffeelint: {
unittests: {
files: {
src: ['test/unit/**/*.coffee']
}
},
taskstests: {
files: {
src: ['test/tasks/**/*.coffee']
}
},
options: {
max_line_length: {
value: 100
}
}
},
'npm-publish': {
options: {
requires: ['build'],
abortIfDirty: true,
tag: function () {
var minor
minor = parseInt(grunt.config('pkg.version').split('.')[1], 10)
if (minor % 2) {
return 'canary'
} else {
return 'latest'
}
}
}
},
'npm-contributors': {
options: {
commitMessage: 'chore: update contributors'
}
},
bump: {
options: {
updateConfigs: ['pkg'],
commitFiles: [
'package.json',
'CHANGELOG.md'
],
commitMessage: 'chore: release v%VERSION%',
push: false,
prereleaseName: 'rc'
}
}
})

grunt.loadTasks('tasks')
require('load-grunt-tasks')(grunt)

grunt.registerTask('build', ['browserify:client'])
grunt.registerTask('default', ['build', 'test', 'lint'])
grunt.registerTask('lint', ['eslint', 'coffeelint'])

grunt.registerTask('release', 'Build, bump and publish to NPM.', function (type) {
grunt.task.run([
'npm-contributors',
'bump:' + (type || 'patch') + ':bump-only',
'build',
'changelog',
'bump-commit',
'npm-publish'
])
})
}
2 changes: 1 addition & 1 deletion lib/middleware/karma.js
Expand Up @@ -168,7 +168,7 @@ var createKarmaMiddleware = function (filesPromise, serveStaticFile,
response.writeHead(200)
response.end(JSON.stringify({
files: files.included.map(function (file) {
return filePathToUrlPath(file.path + '?' + file.sha, basePath, urlRoot);
return filePathToUrlPath(file.path + '?' + file.sha, basePath, urlRoot)
})
}))
})
Expand Down
2 changes: 1 addition & 1 deletion test/unit/file-list.spec.coffee
Expand Up @@ -44,7 +44,7 @@ mockFs = mocks.fs.create
'c.txt': mocks.fs.file 0
'a.js': mocks.fs.file '2012-01-01'

describe.only 'FileList', ->
describe 'FileList', ->
List = list = emitter = preprocess = patternList = mg = modified = glob = null

beforeEach ->
Expand Down

0 comments on commit 48e3000

Please sign in to comment.