File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed
Filter options
Expand file tree Collapse file tree 4 files changed +38
-0
lines changed
Original file line number Diff line number Diff line change 21
21
override :
22
22
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
23
23
- npm run citest-jasmine
24
+ - npm run test-syntax
Original file line number Diff line number Diff line change 32
32
"test-jasmine" : " karma start test/jasmine/karma.conf.js" ,
33
33
"citest-jasmine" : " karma start test/jasmine/karma.ciconf.js" ,
34
34
"test-image" : " ./tasks/test_image.sh" ,
35
+ "test-syntax" : " node test/syntax_test.js" ,
35
36
"test" : " npm run test-jasmine && npm test-image" ,
36
37
"start-test_dashboard" : " node devtools/test_dashboard/server.js" ,
37
38
"start-image_viewer" : " node devtools/image_viewer/server.js" ,
83
84
"browserify" : " ^12.0.1" ,
84
85
"browserify-transform-tools" : " ^1.5.0" ,
85
86
"ecstatic" : " ^1.2.0" ,
87
+ "glob" : " ^6.0.1" ,
86
88
"jasmine-core" : " ^2.3.4" ,
87
89
"jshint" : " ^2.8.0" ,
88
90
"karma" : " ^0.13.15" ,
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ module.exports = {
42
42
pathToTestImagesDiff : path . join ( pathToBuild , 'test_images_diff/' ) ,
43
43
pathToTestImagesDiffList : path . join ( pathToBuild , 'list_of_incorrect_images.txt' ) ,
44
44
45
+ pathToJasmineTests : path . join ( pathToRoot , 'test/jasmine/tests' ) ,
46
+
45
47
uglifyOptions : {
46
48
fromString : true ,
47
49
mangle : true ,
Original file line number Diff line number Diff line change
1
+ var path = require ( 'path' ) ;
2
+ var fs = require ( 'fs' ) ;
3
+
4
+ var jshint = require ( 'jshint' ) . JSHINT ;
5
+ var glob = require ( 'glob' ) ;
6
+
7
+ var constants = require ( '../tasks/util/constants' ) ;
8
+
9
+ var focusGlobals = [ 'fdescribe' , 'fit' ] ;
10
+ var logs = [ ] ;
11
+
12
+
13
+ glob ( path . join ( constants . pathToJasmineTests , '**/*.js' ) , function ( err , files ) {
14
+ files . forEach ( function ( file ) {
15
+ var code = fs . readFileSync ( file , 'utf-8' ) ;
16
+
17
+ jshint ( code ) ;
18
+
19
+ var impliedGlobals = jshint . data ( ) . implieds ;
20
+
21
+ impliedGlobals . forEach ( function ( obj ) {
22
+ if ( focusGlobals . indexOf ( obj . name ) !== - 1 ) {
23
+ logs . push ( [
24
+ path . basename ( file ) ,
25
+ '[line ' + obj . line + '] :' ,
26
+ 'contains either a *fdescribe* or a *fit* block.'
27
+ ] . join ( ' ' ) ) ;
28
+ }
29
+ } ) ;
30
+ } ) ;
31
+
32
+ if ( logs . length ) throw new Error ( logs . join ( '\n' ) ) ;
33
+ } ) ;
You can’t perform that action at this time.
0 commit comments