Skip to content

Commit 68c4a3a

Browse files
authoredJan 12, 2021
chore(test): run client tests without grunt wrapper (#3604)
1 parent fec972f commit 68c4a3a

File tree

6 files changed

+9
-144
lines changed

6 files changed

+9
-144
lines changed
 

‎appveyor.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ install:
2424
- npm run init:windows
2525

2626
test_script:
27-
- npm run test:appveyor
27+
- npm run test:unit
28+
- npm run test:client
2829

2930
build: off
3031

‎gruntfile.js

+2-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
11
module.exports = function (grunt) {
22
grunt.initConfig({
3-
pkg: grunt.file.readJSON('package.json'),
4-
pkgFile: 'package.json',
5-
files: {
6-
server: ['lib/**/*.js'],
7-
client: ['client/**/*.js'],
8-
common: ['common/**/*.js'],
9-
context: ['context/**/*.js'],
10-
grunt: ['grunt.js', 'tasks/*.js']
11-
},
12-
test: {
13-
unit: 'mochaTest:unit',
14-
client: 'test/client/karma.conf.js'
15-
},
163
mochaTest: {
174
options: {
185
reporter: 'dot',
@@ -29,9 +16,7 @@ module.exports = function (grunt) {
2916
}
3017
})
3118

32-
grunt.loadTasks('tasks')
33-
require('load-grunt-tasks')(grunt)
19+
grunt.loadNpmTasks('grunt-mocha-test')
3420

35-
grunt.registerTask('default', ['test'])
36-
grunt.registerTask('test-appveyor', ['test:unit', 'test:client'])
21+
grunt.registerTask('default', ['mochaTest:unit'])
3722
}

‎package-lock.json

-71
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@
461461
"karma-mocha": "^1.0.1",
462462
"karma-mocha-reporter": "^2.0.0",
463463
"karma-script-launcher": "^1.0.0",
464-
"load-grunt-tasks": "^4.0.0",
465464
"mkdirp": "^0.5.0",
466465
"mocha": "^4.1.0",
467466
"mocks": "^0.0.15",
@@ -493,14 +492,13 @@
493492
"scripts": {
494493
"lint": "eslint . --ext js --ignore-pattern *.tpl.js",
495494
"lint:fix": "eslint . --ext js --ignore-pattern *.tpl.js --fix",
496-
"test:unit": "grunt test:unit",
495+
"test:unit": "grunt",
497496
"test:e2e": "cucumber-js test/e2e/*.feature",
498-
"test:client": "grunt test:client",
497+
"test:client": "node bin/karma start test/client/karma.conf.js",
499498
"test": "npm run test:unit && npm run test:e2e && npm run test:client",
500499
"build": "node scripts/client.js build",
501500
"build:check": "node scripts/client.js check",
502501
"build:watch": "node scripts/client.js watch",
503-
"test:appveyor": "grunt test-appveyor",
504502
"test:integration": "./scripts/integration-tests.sh",
505503
"link": "node --eval \"path=require('path'); require('fs').symlinkSync(path.resolve(__dirname), path.resolve(__dirname, 'node_modules', 'karma'), 'junction')\"",
506504
"unlink": "node --eval \"require('fs').unlinkSync(require('path').resolve(__dirname, 'node_modules', 'karma'))\"",

‎tasks/test.js

-48
This file was deleted.

‎test/client/karma.conf.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = function (config) {
102102
// use dots reporter, as travis terminal does not support escaping sequences
103103
// possible values: 'dots', 'progress'
104104
// CLI --reporters progress
105-
reporters: ['progress', 'junit'],
105+
reporters: ['dots'],
106106

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

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

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

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

154154
// report which specs are slower than 500ms
155155
// CLI --report-slower-than 500

0 commit comments

Comments
 (0)
Please sign in to comment.