Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove verbose flag from jest command #1013

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

pallasite99
Copy link
Contributor

Related issue

Closes #886

Context / Background

  • Issue faced with printing console.log() statements when running jest command through scripts

What change is being introduced by this PR?

  • Changes
    • removed verbose flag from jest command in package.json

How will this be tested?

  • Running jest locally with console.log() statement present in one of the unit tests

@codecov
Copy link

codecov bot commented Oct 10, 2023

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
Copy link
Contributor Author

pallasite99 commented Oct 10, 2023

@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
Copy link
Contributor Author

@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
Copy link
Collaborator

Ah, thanks, got it now!

@araujoarthur0 araujoarthur0 merged commit 53978ef into thamara:main Oct 10, 2023
8 checks passed
@tupaschoal
Copy link
Collaborator

\changelog-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running jest without --verbose
3 participants