Closed pallasite99 closed 1 year ago
Merging #1013 (d049835) into main (125433a) will increase coverage by
1.88%
. Report is 1 commits behind head on main. The diff coverage isn/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
@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();
});
});
@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
Ah, thanks, got it now!
\changelog-update
Related issue
Closes #886
Context / Background
console.log()
statements when runningjest
command through scriptsWhat change is being introduced by this PR?
package.json
How will this be tested?
console.log()
statement present in one of the unit tests