1'use strict';
2require('../common');
3const fixtures = require('../common/fixtures');
4const assert = require('node:assert');
5const { spawnSync } = require('node:child_process');
6const { test } = require('node:test');
7const cwd = fixtures.path('test-runner', 'default-behavior');
8const env = { ...process.env, 'NODE_DEBUG': 'test_runner' };
9
10test('default concurrency', async () => {
11  const args = ['--test'];
12  const cp = spawnSync(process.execPath, args, { cwd, env });
13  assert.match(cp.stderr.toString(), /concurrency: true,/);
14});
15
16test('concurrency of one', async () => {
17  const args = ['--test', '--test-concurrency=1'];
18  const cp = spawnSync(process.execPath, args, { cwd, env });
19  assert.match(cp.stderr.toString(), /concurrency: 1,/);
20});
21
22test('concurrency of two', async () => {
23  const args = ['--test', '--test-concurrency=2'];
24  const cp = spawnSync(process.execPath, args, { cwd, env });
25  assert.match(cp.stderr.toString(), /concurrency: 2,/);
26});
27