Skip to content

Add support for OS selectors on Node.js platform #742

@cedx

Description

@cedx

I have tests that are run according to the operating system using the testOn parameter of the group() and test() functions. These tests are cross-platform: they are launched on the Dart VM but also on the Node.js platform.

For example:

import 'package:test/test.dart';

void main() => group('Class', () {
  group('.method()', () {
    test('should be run on POSIX platforms', () {
      expect(..., ...);
    }, testOn: 'posix');

    test('should be run on Windows platform', () {
      expect(..., ...);
    }, testOn: 'windows');
  });
});

Currently, when these tests are run on Node.js, all tests using the testOn parameter are ignored by the runner because on Node.js the operating system selectors (i.e. linux, mac-os, windows...) return false.

I wonder if it could be possible that these OS selectors could take the Node.js platform into account, that is return true for the windows selector if the platform is Node.js and the operating system is Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions