mocha-parallel-tests icon indicating copy to clipboard operation
mocha-parallel-tests copied to clipboard

Using mocha-parallel-tests with runtime generated Mocha test suite

Open richard-hor-bgl opened this issue 3 years ago • 0 comments

Hi there,

I have some sample Mocha codes as below:

function runMochaTestSuite(testSuite) {
  describe(testSuite.name, function () {
    for (testCase of testSuite.testCases) {
      it(testCase.name, function () {
      });
    }
  });
}
const myTestSuites = [
  {
    name: "Test Suite 1",
    testCases: [
      {
        name: "Test Case 1-1",
      },
      {
        name: "Test Case 1-2",
      },
    ],
  },
  {
    name: "Test Suite 2",
    testCases: [
      {
        name: "Test Case 2-1",
      },
      {
        name: "Test Case 2-2",
      },
    ],
  },
];
for (suite of myTestSuites) {
  runMochaTestSuite(suite);
}

I run this ok with Mocha.

I wonder how can i use mocha-parallel-tests to run this kind of Mocha tests.

Much appreciated for your help. Thank you in advance.

richard-hor-bgl avatar Mar 26 '21 03:03 richard-hor-bgl