thamara / time-to-leave

Log work hours and get notified when it's time to leave the office and start to live.
http://timetoleave.app
GNU General Public License v3.0
463 stars 272 forks source link

remove verbose flag from jest command #1013

Closed pallasite99 closed 1 year ago

pallasite99 commented 1 year ago

Related issue

Closes #886

Context / Background

What change is being introduced by this PR?

How will this be tested?

codecov[bot] commented 1 year ago

Codecov Report

Merging #1013 (d049835) into main (125433a) will increase coverage by 1.88%. Report is 1 commits behind head on main. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
+ Coverage   70.68%   72.56%   +1.88%     
==========================================
  Files          26       26              
  Lines        2180     2180              
  Branches      345      345              
==========================================
+ Hits         1541     1582      +41     
+ Misses        639      598      -41     

see 3 files with indirect coverage changes

pallasite99 commented 1 year ago

@araujoarthur0 This is where I see the console appearing according to the terminal:

console.log
      { response: 1 }

      at js/menus.js:368:29

This is the test file which is same as current one in codebase which results in the console being printed, although when I traced the line it is a console.log(error):

describe('menus.js', () =>
{
    const mocks = {};

    describe('getMainMenuTemplate', () =>
    {
        test('Should have 3 options', () =>
        {
            expect(getMainMenuTemplate().length).toBe(3);
        });

        getMainMenuTemplate().forEach((menu) =>
        {
            test('Should be a separator or valid field', () =>
            {
                const tests = [
                    {field : 'label', type: 'string'},
                    {field : 'click', type: 'function'},
                ];
                if ('type' in menu)
                {
                    expect(menu.type).toBe('separator');
                }
                else
                {
                    for (const t of tests)
                    {
                        expect(menu[t.field]).toBeTruthy();
                        expect(typeof menu[t.field]).toBe(t.type);
                    }
                    if ('id' in menu)
                    {
                        expect(typeof menu.id).toBe('string');
                    }
                    if ('accelerator' in menu)
                    {
                        expect(typeof menu.accelerator).toBe('string');
                    }
                }
            });
        });

        test('Should open waiver window', (done) =>
        {
            mocks.waiver = jest.spyOn(windows, 'openWaiverManagerWindow').mockImplementationOnce( () =>
            {
                done();
            });
            getMainMenuTemplate()[0].click();
        });

        test('Should close app', (done) =>
        {
            mocks.quit = jest.spyOn(app, 'quit').mockImplementationOnce(() =>
            {
                done();
            });
            getMainMenuTemplate()[2].click();
        });
    });
pallasite99 commented 1 year ago

@araujoarthur0 Another similar error console:

 PASS       MAIN  __tests__/__main__/date-aux.js
 PASS   RENDERER  __tests__/__renderer__/classes/BaseCalendar.js
  ● Console

    console.log
      undefined

      at js/classes/BaseCalendar.js:89:25
araujoarthur0 commented 1 year ago

Ah, thanks, got it now!

tupaschoal commented 1 year ago

\changelog-update