ts-jest only prints out usage message - ts-jest

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...

Related

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...

go test ./package dumps Stdout of successful tests, not just the failed test

While writing a CLI tool that outputs to stdout, I noticed that if one test fails, then whatever the other (successful) tests had also written to stdout gets dumped out as well, which is misleading.
Is this to be expected, or should I set os.Stdout to /dev/null while testing? but then how would the testing package find anything to print out?
The test package doesn't interfere with the standard output of code under test, whether it passes or fails. If it's important for you not to see this output, you can capture stdout while executing your specific test and then decided what to do with it based on the test outcome.
Try to use -failfast. Following an example.
$ go test -failfast -coverprofile=coverage.out -covermode=count <pkg path>

Problems running bash script from incron

I have a simple incron task setup to run a command whenever a particular .json file is written-to, then closed.
/var/www/html/api/private/resources/myfile.json IN_CLOSE_WRITE,IN NO LOOP /var/www/html/api/private/resources/run_service.sh
I can see that whenever the file to written to, there is a syslog entry for the event, and the command that was triggered - along the lines of <date> - incrond: CMD (/var/www/html/api/private/resources/run_service.sh).
But nothing seems to happen...
initially I thought this would be caused by an issue with the script, but replacing the script command to something simple such as echo "hello world" > /tmp/mylog.log still yields no output or results. I seem to have hit a brick wall with this one!
Update
Changing the incron command to read "/bin/bash /var/www/html/api/private/resources/run_service.sh" now seems to triggering the script correctly, as I can now get output from the script.
A simple mistake on my part, despite all examples online showing that using the script as the command should run it, for me it only works if I explicitly call bash to execute it
"<my directory/file to watch> <trigger condition> /bin/bash /var/www/html/api/private/resources/run_service.sh

Logging from grunt-contrib-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.

Calling Rspec with syntax like ruby -I

I am trying to use https://github.com/rifraf/Vendorize which is run using a command like
D:\projects\SomeLibrary\lib>ruby -I..\..\Vendorize\lib -rvendorize some_lib.rb
It does something clever where it intercepts required files and logs them, but only the ones that get executed in your command line. On it's documentation pages it says
You can run the program several times with different options if the
required files depend on the options.
Or just run your tests…
I want to run all the tests with the -I function from the command line above, so that all the different avenues of code are run, and the libraries loaded (and logged). Given that I can run them like:
D:\projects\SomeLibrary\lib>rspec ..\spec\some_spec.rb
How do I do this? Thanks!
NB: I am a/ a ruby newbie and b/ running windows
I would try writing something like this at the top of some_spec.rb:
require_relative '..\..\Vendorize\lib\vendorize'
You might need to change that a bit depending on what your working directory is.
Then just runs your specs with rspec as you normally do without any extra commands.
If that doesn't work, then locate the rspec.rb executable and run:
ruby -I..\..\Vendorize\lib -rvendorize path/to/rspec.rb ..\spec\some_spec.rb

Resources