jest how to see all uncovered lines in CLI? - jestjs

I want to see uncovered lines which is hidden by "..." like: "... 03,104,107,111"
Any ideas?
validation.ts | 76.92 | 82.61 | 53.33 | 76.19 |... 03,104,107,111 |
worklistPage-util.ts | 0 | 0 | 0 | 0 |... 63,68,69,70,73 |

I found a solution, but not for the CLI.
I was able to check all uncovered lines by type start coverage/lcov-report/index.html which is created by istanbul.js in Window system

Related

Recursively add prefix to file names and moving these files from all subdirectories to a specified directory (linux environment)

I'd like to rename the files with the unique sample name (which is the title of the subdirectory 2 levels above the files).
Here is a snippet of the directory structure:
|-RNAdata
| |-Sample1
| | |-cufflinks
| | | |-genes.fpkm_tracking
| | | |-skipped.gtf
| | | |-isoforms.fpkm_tracking
| | | |-transcripts.gtf
| |-Sample2
| | |-cufflinks
| | | |-genes.fpkm_tracking
| | | |-skipped.gtf
| | | |-isoforms.fpkm_tracking
| | | |-transcripts.gtf
There are about 1000 files like this. I'd like to be able to see something like this:
|-RNAdata
| |-Sample1_genes.fpkm_tracking
| |-Sample1_skipped.gtf
| |-Sample1_isoforms.fpkm_tracking
| |-Sample1_transcripts.gtf
| |-Sample2_genes.fpkm_tracking
| |-Sample2_skipped.gtf
| |-Sample2_isoforms.fpkm_tracking
| |-Sample2_transcripts.gtf
I'm working in a Linux environment and have very basic knowledge on file management with this language. Any advice/suggestions for resources on this type of work, that would be great! I'd like to learn this so I can be more independent with this. Thank you!

Instanbul/Nyc only picking up some files

I tried to set up Istanbul/Nyc/Mocha for test coverage for my project and although I was able to run Nyc successfully, I am only able to see some files being picked up for test coverage not all the .ts files that I have.
So when I run
npm run coverage
I get
-----------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------------|---------|----------|---------|---------|-------------------
All files | 0 | 100 | 100 | 0 |
develop-potta | 0 | 100 | 100 | 0 |
swagger.ts | 0 | 100 | 100 | 0 | 1
develop-potta/models | 0 | 100 | 100 | 0 |
students.ts | 0 | 100 | 100 | 0 | 1
swaggerDefinition.ts | 0 | 100 | 100 | 0 | 1
develop-potta/routes | 0 | 100 | 100 | 0 |
routescontroller.ts | 0 | 100 | 100 | 0 | 4-5
This only covers about 50% of my code base. For example I have a develop-potta/DBConnection/OracleConnection.ts which is also a ts file which isn't being picked up by my script. I am unable to figure out why? Could it be a certain naming convention? Could it be that I didn't export those modules?
Typescript + mocha + nyc can be picky. Especially the all: true setting messes up the coverage a lot. But as you mention it's hard to bring it cover all files. My template repo covers those cases. Maybe it can help you.
https://github.com/Flowkap/typescript-node-template
If you're only interested in coverage check the .ncyrc.yml and mocharc.yml as well as the call config in package.json. VsCode launch configs also included.

MATCH-formula where 'lookup_value' is array

I have 3 Excel-files (automated exports) that contain the following information:
1. The total list of shelves in one particular store:
| Shelf_code |
|------------|
| AB01 |
| AA02 |
2. The total list of all shelves linked to each article
| SKU_code | Shelf_code |
|----------|------------|
| 111 | AA01 |
| 111 | AB01 |
| 111 | AC01 |
| 112 | AA01 |
3. The list of all available SKUs
| SKU_code | Other stuff |
|----------|-------------|
| 111 | ... |
| 112 | ... |
| 113 | ... |
| 114 | ... |
And what I want to do is to link the Shelf_codes from that specific store to the total available SKU-list, so it will look like this:
| SKU_code | Other stuff | Shelf_code_store1 |
|----------|-------------|-------------------|
| 111 | ... | AB01 |
| 112 | ... | |
| 113 | ... | |
| 114 | ... | AB01 |
I have tried to embed the MATCH formula within another INDEX/MATCH formula (see code below) which was partially successful since this will only work if the shelf_code in file 2 happens to be the first one to match the SKU_code.
Since this will be mostly not the case, it will return a #N/A error
MATCH(
INDEX({file2_shelfcode},MATCH(file3_skucode,{file2_skucode},0)),
{file1_shelfcode}
)
Does anyone has a solution for this?
Since these files contain over 1000 articles, 200 shelves, 6 stores, and will be frequently updated I don't think using a Pivottable on file 2 will fit my needs.

Incorrect stats_reset value in pg_stat_bgwriter

I am checking the stats of background process by below command:
select * from pg_stat_bgwriter ;
But after resetting the stats by command:
select pg_stat_reset() ;
I am expecting the column stats_reset return the time at which stats reset, but it shows the very old time. Any idea or guidance on this ?
Example output:
checkpoints_timed | checkpoints_req | checkpoint_write_time |
checkpoint_sync_time | buffers_checkpoint | buffers_clean |
maxwritten_c lean | buffers_backend | buffers_backend_fsync |
buffers_alloc | stats_reset
-------------------+-----------------+-----------------------+----------------------+--------------------+---------------+-------------
-----+-----------------+-----------------------+---------------+-------------------------------
2525 | 9 | 193751796 | 322501 | 3162662 | 30839 | 176 | 451310 |
0 | 4120735 | 2016-09-27 08:32:43.638545-05
Thanks
Got the answer in the documentation : Doc- link
bgwriter is the shared among all the databases so it can be reset by different function by the below command:
pg_stat_reset_shared('bgwriter') ;

Write a command to increase or decrease the number of vertical splits

I usually have my Vim screen split into two vertical windows, each of which may be further horizontally split. Sometimes, I want to add or delete a vertical window. Is there a way to detect how many top-level vertical splits there are and add or remove vsplits as necessary?
For example, suppose my screen looks like this:
+--------+--------+
| | |
| | |
+--------+ |
| | |
| | |
| +--------+
| | |
+--------+--------+
I want :Columns 1 to give me
+--------+
| |
| |
+--------+
| |
| |
| |
| |
+--------+
by closing the two right-most windows.
I want :Columns 2 to do nothing, detecting that two columns are already open.
And I want :Columns 3 to give me
+--------+--------+--------+
| | | |
| | | |
+--------+ | |
| | | |
| | | |
| +--------+ |
| | | |
+--------+--------+--------+
I am fine if the function ignores vertical splits within horizontal splits. For example, if I had
+--------+
| |
| |
+---+----+
| | |
| | |
| | |
| | |
+---+----+
and I ran :Columns 2, I would get
+--------+--------+
| | |
| | |
+---+----+ |
| | | |
| | | |
| | | |
| | | |
+---+----+--------+
There is indeed a way, but it is involved; the first step is to count the currently-open vertical windows, and I don’t know of any built-in function that facilitates this. The working approach I found to it is basically to start at the first window (the top of the first — if not the entirety of the first — vertical split), and to then, using wincmd l, move to the next window to the right for as long as wincmd l moves to a new window, adding each to a count of open vertical windows including the first one. (I think this is what Gary Fixler referred to in the comments on the question.)
I started trying to write the code for posting here, and it grew to become larger than any function I would want to put in my ~/.vimrc, so I ended up turning it into a plugin which takes the above approach and provides the :Columns command; see Columcille (on vim.org at http://www.vim.org/scripts/script.php?script_id=4742.) The plugin also provides a command for similarly managing horizontal split windows: :Rows divides the current column (or the main window, if there are no open vertical splits) into the specified number of “rows.”

Resources