Skip to content

unittest reports wrong result if group setup fails #2933

Closed
@jmesserly

Description

@jmesserly

unittest will happily report "PASS" even if the group setup failed. I know this happens in the html configuration (see example below), not sure if it happens in other configurations.

I expect a failure, but this is the result. Note that only 1/1 tests ran:


PASS
1 PASS Expectation: Color first.
All 1 tests passed


Here's the code:


library('bug_example');

import('../dart/dart/lib/unittest/html_config.dart');

import('../dart/dart/lib/unittest/unittest.dart');

main() {
  useHtmlConfiguration();
  group('Color', () {
    test('first', () {
      Expect.isTrue(true);
    });

    throw new Exception('foobar');

    test('second', () {
      Expect.isTrue(true);
    });
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failuresarea-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions