Logging from grunt-contrib-jasmine - jasmine

I'm using grunt-contrib-jasmine to run my javascript specs. How do I write debug output to the console when running specs i.e. how do I get
console.log("something");
to show output in the console? I do find that I can get output by running:
$ grunt jasmine --verbose
But this prints a lot of information that I'm not interested in. How can I just see the output from console.log ?

Use console.info instead of console.log

Not a solution but a work around (sort of).
Put in a expect("something").toBe(null); This will make jasmine to write out an error message like: Expected 'something' to be null. This way you can peek into objects (expect(element).toBe(null);)

You can also use dump(variable) or console.log(variable). Source is the excellent Year of Moo.

Related

ts-jest only prints out usage message

I cannot get it to run, at all.
ts-jest config:init initializes the config but every other command I can imagine just prints out an infuriatingly useless usage message:
Usage:
ts-jest command [options] [...args]
The command “do your only job” does not seem to work. Obviously, I have something very basic wrong.
ts-jest’s job is apparently not to run the test, but just to re-write the configuration so it works with Typescript. You have to run jest yourself to actually do any testing...

Running shell script with more information

My script get stuck in some point and it doesn't show any error. I would like to know why and where it gets stuck. Is there a possibility to run a script and show me more information what is it running?
I have found -x command to run it in debug mode but I have a lot of scripts which are connected and it doesn't work for me.
With -vvv I have also tried, but somehow it doesn't show more than without it.
Does anyone know another command for that?
Read:
https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html
... and this:
https://unix.stackexchange.com/questions/155551/how-to-debug-a-bash-script
... and if that's not enough, look at the gdb-like bash debugger:
http://bashdb.sourceforge.net/
and many moore...

How can I have ruby logger log for each line of execution?

I am very new to ruby, just started learning for doing a automation with cucumber and Gherkin.
I wanted to capture the each and every action into the logs!!!
Is there a way to capture!!! Thanks for your advice in advance!!!
Thanks
Ashok Natarajan
If your question is about cucumber logging, check out the man page for available options. Try:
cucumber -v -b -x
-b, --backtrace Show full backtrace for all errors.
-v, --verbose Show the files and features loaded.
-x, --expand Expand Scenario Outline Tables in output.
The easiest way to log things in cucumber is using simple puts statements. if you don't want it to show up in the reports you could use kernel.puts
I have also used pry for real time debugging like this:
http://www.alanmacdougall.com/blog/2012/06/08/interactive-debugging-with-pry/
You must also remember to gather any output from gems that you are using. For example if you use the sequel gem you will probably want to log the database statements. you could use something like
require 'logger'
DB.loggers << Logger.new($stdout)

Logging to rake's trace log

Is it possible to print custom messages to the output of rake --trace?
The cheap and nasty way (for anyone reading) is to run rake with the --verbose option, then use the standard puts Ruby function to write out your debug line.
But it is nasty.

How to know the result of the JMeter test from command line?

I would like to know if there any flag for the following command to know the test result on the command line itself?
jmeter.bat -n -t "../Tests/testPlan.jmx" -l "../Tests/testResult.xml"
I don't want to open testResult.xml to learn if the test is pass or fail.
Regards
Chaitanya
Use Summary properties
The Non-GUI mode needs other properties set in order to print to System.out. See the blog above.
# Write messages to System.out
summariser.out=true
As far as I know there isn't. You can check all the options available here. Although, if the output is more or less similar you could write a script to automate that process.
Actually there is some other command-line way: http://code.google.com/p/jmeter-plugins/wiki/JMeterPluginsCMD

Resources