Skip to content

Commit

Permalink
chore(test): run client tests without grunt wrapper (#3604)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoto13 authored Jan 12, 2021
1 parent fec972f commit 68c4a3a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 144 deletions.
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ install:
- npm run init:windows

test_script:
- npm run test:appveyor
- npm run test:unit
- npm run test:client

build: off

Expand Down
19 changes: 2 additions & 17 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkgFile: 'package.json',
files: {
server: ['lib/**/*.js'],
client: ['client/**/*.js'],
common: ['common/**/*.js'],
context: ['context/**/*.js'],
grunt: ['grunt.js', 'tasks/*.js']
},
test: {
unit: 'mochaTest:unit',
client: 'test/client/karma.conf.js'
},
mochaTest: {
options: {
reporter: 'dot',
Expand All @@ -29,9 +16,7 @@ module.exports = function (grunt) {
}
})

grunt.loadTasks('tasks')
require('load-grunt-tasks')(grunt)
grunt.loadNpmTasks('grunt-mocha-test')

grunt.registerTask('default', ['test'])
grunt.registerTask('test-appveyor', ['test:unit', 'test:client'])
grunt.registerTask('default', ['mochaTest:unit'])
}
71 changes: 0 additions & 71 deletions package-lock.json

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

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@
"karma-mocha": "^1.0.1",
"karma-mocha-reporter": "^2.0.0",
"karma-script-launcher": "^1.0.0",
"load-grunt-tasks": "^4.0.0",
"mkdirp": "^0.5.0",
"mocha": "^4.1.0",
"mocks": "^0.0.15",
Expand Down Expand Up @@ -493,14 +492,13 @@
"scripts": {
"lint": "eslint . --ext js --ignore-pattern *.tpl.js",
"lint:fix": "eslint . --ext js --ignore-pattern *.tpl.js --fix",
"test:unit": "grunt test:unit",
"test:unit": "grunt",
"test:e2e": "cucumber-js test/e2e/*.feature",
"test:client": "grunt test:client",
"test:client": "node bin/karma start test/client/karma.conf.js",
"test": "npm run test:unit && npm run test:e2e && npm run test:client",
"build": "node scripts/client.js build",
"build:check": "node scripts/client.js check",
"build:watch": "node scripts/client.js watch",
"test:appveyor": "grunt test-appveyor",
"test:integration": "./scripts/integration-tests.sh",
"link": "node --eval \"path=require('path'); require('fs').symlinkSync(path.resolve(__dirname), path.resolve(__dirname, 'node_modules', 'karma'), 'junction')\"",
"unlink": "node --eval \"require('fs').unlinkSync(require('path').resolve(__dirname, 'node_modules', 'karma'))\"",
Expand Down
48 changes: 0 additions & 48 deletions tasks/test.js

This file was deleted.

6 changes: 3 additions & 3 deletions test/client/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ module.exports = function (config) {
// use dots reporter, as travis terminal does not support escaping sequences
// possible values: 'dots', 'progress'
// CLI --reporters progress
reporters: ['progress', 'junit'],
reporters: ['dots'],

junitReporter: {
// will be resolved to basePath (in the same way as files/exclude patterns)
Expand All @@ -124,7 +124,7 @@ module.exports = function (config) {

// enable / disable watching file and executing tests whenever any file changes
// CLI --auto-watch --no-auto-watch
autoWatch: true,
autoWatch: false,

// Start these browsers, currently available:
// - Chrome
Expand All @@ -149,7 +149,7 @@ module.exports = function (config) {

// Auto run tests on start (when browsers are captured) and exit
// CLI --single-run --no-single-run
singleRun: false,
singleRun: true,

// report which specs are slower than 500ms
// CLI --report-slower-than 500
Expand Down

0 comments on commit 68c4a3a

Please sign in to comment.