Skip to content

Commit

Permalink
Move ESLint and karma tests to npm scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 3, 2021
1 parent f8dac22 commit 1358c60
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 169 deletions.
28 changes: 4 additions & 24 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,15 @@ module.exports = function (grunt) {
'package.json'
]
}
},
karma: {
options: {
singleRun: true
},
adapter: {
configFile: 'karma.conf.js'
},
simplequnit: {
configFile: 'examples/simple/karma.conf.js'
}
},
eslint: {
target: [
'src/adapter.js',
'lib/index.js',
'test/**/*.js',
'examples/**/*.js',
'gruntfile.js',
'karma.conf.js'
]
}
})

require('load-grunt-tasks')(grunt)
grunt.loadNpmTasks('grunt-bump')
grunt.loadNpmTasks('grunt-npm')
grunt.loadTasks('tasks')

grunt.registerTask('test', ['eslint', 'build', 'karma'])
grunt.registerTask('default', ['test'])
grunt.registerTask('test', ['build'])
grunt.registerTask('default', ['build'])

grunt.registerTask('release', 'Bump the version and publish to NPM.', function (type) {
grunt.task.run([
Expand Down
151 changes: 12 additions & 139 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
"description": "A Karma plugin. Adapter for QUnit testing framework.",
"main": "lib/index.js",
"scripts": {
"lint": "grunt eslint",
"test": "grunt && mocha test/lib"
"build": "grunt build",
"lint": "eslint .",
"karma": "npm run karma:adapter && npm run karma:simplequnit",
"karma:adapter": "karma start karma.conf.js --single-run",
"karma:simplequnit": "karma start examples/simple/karma.conf.js --single-run",
"mocha": "mocha test/lib",
"test": "npm run lint && npm run build && npm run karma && npm run mocha"
},
"repository": {
"type": "git",
Expand All @@ -28,21 +33,19 @@
"dependencies": {},
"devDependencies": {
"chai": "^4.2.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.1.0",
"grunt": "1.1.0",
"grunt-bump": "^0.8.0",
"grunt-eslint": "^22.0.0",
"grunt-karma": "^4.0.0",
"grunt-npm": "0.0.2",
"karma": "^5.2.3",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^1.3.0",
"karma-jasmine": "^3.3.1",
"load-grunt-tasks": "^5.1.0",
"mocha": "^7.2.0",
"qunit": "^2.14.0"
},
Expand Down
1 change: 0 additions & 1 deletion tasks/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = function (grunt) {

// Build given file - wrap it with a function call
// TODO(vojta): compile with uglify-js
grunt.registerMultiTask('build', 'Wrap given file into a function call.', function () {
Expand Down

0 comments on commit 1358c60

Please sign in to comment.