Skip to content

many tests are never being run due to nested if() calls in Mocha #46806

@ckerr

Description

@ckerr

Description

Nested it()s are not executed in Mocha, so any of our tests written this way are never run. There are several in api-browser-window-spec.ts and in other files.

Some examples:

api-browser-window-spec.ts:      it('with functions', () => {
api-browser-window-spec.ts:        it('can be changed', () => {
api-browser-window-spec.ts-          const w = new BrowserWindow({ show: false });
api-browser-window-spec.ts-          expect(w.getRepresentedFilename()).to.eql('');
api-browser-window-spec.ts-          w.setRepresentedFilename('a name');
--
api-browser-window-spec.ts:      it('with properties', () => {
api-browser-window-spec.ts:        it('can be set with minimizable constructor option', () => {
api-browser-window-spec.ts-          const w = new BrowserWindow({ show: false, minimizable: false });
api-browser-window-spec.ts-          expect(w.minimizable).to.be.false('minimizable');
api-browser-window-spec.ts-        });
--
api-browser-window-spec.ts:      it('with functions', () => {
api-browser-window-spec.ts:        it('can be set with minimizable constructor option', () => {
api-browser-window-spec.ts-          const w = new BrowserWindow({ show: false, minimizable: false });
api-browser-window-spec.ts-          expect(w.isMinimizable()).to.be.false('movable');
api-browser-window-spec.ts-        });

These tests are just never getting run. You can negate the expected results and the tests still pass. 😱

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions