Add support for grunt test
phun-ky opened this issue · 2 comments
phun-ky commented
In the package.json
-file, there's a script for test: grunt test
, but currently we have no tests(!). Will add basic test support, based on running the retire
-task in Gruntfile.js
phun-ky commented
I've added this in the Gruntifle.js
-file:
grunt.registerTask('test', ['retire']);
But when I run the task, I get some errors I can't figure out how to solve. I think it has something to do with async
or the internal node timers:
Running this command: grunt test --verbose --debug --stack
�[4mInitializing�[24m
Command-line options: �[36m--verbose�[39m, �[36m--debug=1�[39m, �[36m--stack�[39m
Reading "Gruntfile.js" Gruntfile...�[32mOK�[39m
�[1mRegistering Gruntfile tasks.�[22m
Initializing config...�[32mOK�[39m
�[1mRegistering "tasks" tasks.�[22m
Loading "retire.js" tasks...�[32mOK�[39m
+ �[36mretire�[39m
�[1mRegistering "grunt-contrib-jshint" local Npm module tasks.�[22m
Reading c:\Users\QE1\Workspace\grunt-retire\node_modules\grunt-contrib-jshint\package.json...�[32mOK�[39m
Parsing c:\Users\QE1\Workspace\grunt-retire\node_modules\grunt-contrib-jshint\package.json...�[32mOK�[39m
Loading "jshint.js" tasks...�[32mOK�[39m
+ �[36mjshint�[39m
Loading "Gruntfile.js" tasks...�[32mOK�[39m
+ �[36mdefault�[39m, �[36mtest�[39m
Running tasks: �[36mtest�[39m
�[4mRunning "test" task�[24m
[D] �[35mTask source: c:\Users\QE1\Workspace\grunt-retire\Gruntfile.js�[39m
�[4mRunning "retire" task�[24m
[D] �[35mTask source: tasks\retire.js�[39m
�[4mRunning "retire:node" (retire) task�[24m
[D] �[35mTask source: tasks\retire.js�[39m
Verifying property �[36mretire.node�[39m exists in config...�[32mOK�[39m
Files: �[36mtest-files�[39m, �[36mtest-files/bower.json�[39m, �[36mtest-files/dojo.js�[39m, �[36mtest-files/jquery-1.6.js�[39m, �[36mtest-files/not-js.txt�[39m, �[36mtest-files/package.json.vulnerable�[39m, �[36mtest-files/safe.js�[39m -> �[36mnode�[39m
Options: �[36mverbose�[39m, �[36mpackageOnly�[39m, �[36mjsRepository="https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json"�[39m, �[36mnodeRepository="https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json"�[39m, �[36mlogger=undefined�[39m, �[36mwarnlogger=undefined�[39m
Ignoring []
Options: �[36mverbose�[39m, �[36mpackageOnly�[39m, �[36mjsRepository="https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json"�[39m, �[36mnodeRepository="https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json"�[39m, �[36mlogger=undefined�[39m, �[36mwarnlogger=undefined�[39m, �[36mcachedir="C:\\Users\\QE1\\AppData\\Local\\Temp\\.retire-cache"�[39m, �[36mignore=[]�[39m
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json
Reading C:\Users\QE1\AppData\Local\Temp\.retire-cache\1418385538407.json ...
[D] �[35mSkipping. Could not find: test-files/package.json�[39m
[D] �[35mSkipping. Could not find: test-files/bower.json/package.json�[39m
[D] �[35mSkipping. Could not find: test-files/dojo.js/package.json�[39m
[D] �[35mSkipping. Could not find: test-files/jquery-1.6.js/package.json�[39m
[D] �[35mSkipping. Could not find: test-files/not-js.txt/package.json�[39m
[D] �[35mSkipping. Could not find: test-files/package.json.vulnerable/package.json�[39m
[D] �[35mSkipping. Could not find: test-files/safe.js/package.json�[39m
asd
No vulnerabilities found.
�[4mRunning "retire:js" (retire) task�[24m
[D] �[35mTask source: tasks\retire.js�[39m
Verifying property �[36mretire.js�[39m exists in config...�[32mOK�[39m
Files: �[36mtest-files/dojo.js�[39m, �[36mtest-files/jquery-1.6.js�[39m, �[36mtest-files/safe.js�[39m, �[36mtest-files/bower.json�[39m -> �[36mjs�[39m
Options: �[36mverbose�[39m, �[36mpackageOnly�[39m, �[36mjsRepository="https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json"�[39m, �[36mnodeRepository="https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json"�[39m, �[36mlogger=undefined�[39m, �[36mwarnlogger=undefined�[39m
Ignoring []
Options: �[36mverbose�[39m, �[36mpackageOnly�[39m, �[36mjsRepository="https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json"�[39m, �[36mnodeRepository="https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json"�[39m, �[36mlogger=undefined�[39m, �[36mwarnlogger=undefined�[39m, �[36mcachedir="C:\\Users\\QE1\\AppData\\Local\\Temp\\.retire-cache"�[39m, �[36mignore=[]�[39m
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json
Reading C:\Users\QE1\AppData\Local\Temp\.retire-cache\1418385540121.json ...
Checking: test-files/dojo.js
test-files/dojo.js
↳ dojo 1.4.2
Checking: test-files/jquery-1.6.js
�[31m>> �[39mtest-files/jquery-1.6.js
�[31m>> �[39m↳ jquery 1.6 has known vulnerabilities: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4969 http://research.insecurelabs.org/jquery/test/ http://bugs.jquery.com/ticket/11290
Checking: test-files/safe.js
Checking: test-files/bower.json
�[31m>> �[39mtest-files/bower.json
�[31m>> �[39m↳ jquery 1.4.2 has known vulnerabilities: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-4969 http://research.insecurelabs.org/jquery/test/ http://bugs.jquery.com/ticket/11290
asd
�[33mWarning: Task "retire:js" failed.� Use --force to continue.�[39m
Error: Task "retire:js" failed.
at Task.<anonymous> (c:\Users\QE1\Workspace\grunt-retire\node_modules\grunt\lib\util\task.js:205:15)
at null._onTimeout (c:\Users\QE1\Workspace\grunt-retire\node_modules\grunt\lib\util\task.js:241:33)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
�[31mAborted due to warnings.�[39m