Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Aug 22, 2023
1 parent 2a75a33 commit ac6265d
Show file tree
Hide file tree
Showing 33 changed files with 1,343 additions and 879 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ const { result } = concurrently(
killOthers: ['failure', 'success'],
restartTries: 3,
cwd: path.resolve(__dirname, 'scripts'),
}
},
);
result.then(success, failure);
```
Expand Down
50 changes: 25 additions & 25 deletions bin/concurrently.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ const run = (args: string, ctrlcWrapper?: boolean) => {
/** The signal by which the child process was terminated. */
signal: exit[1],
};
})
)
}),
),
);

const getLogLines = async (): Promise<string[]> => {
Expand Down Expand Up @@ -197,9 +197,9 @@ describe('exiting conditions', () => {
// TODO: Flappy value due to race condition, sometimes killed by concurrently (exit code 1),
// sometimes terminated on its own (exit code 0).
// Related issue: https://github.com/open-cli-tools/concurrently/issues/283
isWindows ? '(3221225786|0|1)' : 'SIGINT'
)
)
isWindows ? '(3221225786|0|1)' : 'SIGINT',
),
),
);
});
});
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('--hide', () => {
describe('--group', () => {
it('groups output per process', async () => {
const lines = await run(
'--group "echo foo && node fixtures/sleep.mjs 1 && echo bar" "echo baz"'
'--group "echo foo && node fixtures/sleep.mjs 1 && echo bar" "echo baz"',
).getLogLines();

expect(lines.slice(0, 4)).toEqual([
Expand All @@ -257,7 +257,7 @@ describe('--names', () => {

it('is split using --name-separator arg', async () => {
const lines = await run(
'--names "foo|bar" --name-separator "|" "echo foo" "echo bar"'
'--names "foo|bar" --name-separator "|" "echo foo" "echo bar"',
).getLogLines();

expect(lines).toContainEqual(expect.stringContaining('[foo] foo'));
Expand Down Expand Up @@ -302,50 +302,50 @@ describe('--kill-others', () => {

expect(lines).toContainEqual(expect.stringContaining('[1] exit 0 exited with code 0'));
expect(lines).toContainEqual(
expect.stringContaining('Sending SIGTERM to other processes')
expect.stringContaining('Sending SIGTERM to other processes'),
);
expect(lines).toContainEqual(
expect.stringMatching(
createKillMessage('[0] node fixtures/sleep.mjs 10', 'SIGTERM')
)
createKillMessage('[0] node fixtures/sleep.mjs 10', 'SIGTERM'),
),
);
});
});

it('kills on failure', async () => {
const lines = await run(
'--kill-others "node fixtures/sleep.mjs 10" "exit 1"'
'--kill-others "node fixtures/sleep.mjs 10" "exit 1"',
).getLogLines();

expect(lines).toContainEqual(expect.stringContaining('[1] exit 1 exited with code 1'));
expect(lines).toContainEqual(expect.stringContaining('Sending SIGTERM to other processes'));
expect(lines).toContainEqual(
expect.stringMatching(createKillMessage('[0] node fixtures/sleep.mjs 10', 'SIGTERM'))
expect.stringMatching(createKillMessage('[0] node fixtures/sleep.mjs 10', 'SIGTERM')),
);
});
});

describe('--kill-others-on-fail', () => {
it('does not kill on success', async () => {
const lines = await run(
'--kill-others-on-fail "node fixtures/sleep.mjs 0.5" "exit 0"'
'--kill-others-on-fail "node fixtures/sleep.mjs 0.5" "exit 0"',
).getLogLines();

expect(lines).toContainEqual(expect.stringContaining('[1] exit 0 exited with code 0'));
expect(lines).toContainEqual(
expect.stringContaining('[0] node fixtures/sleep.mjs 0.5 exited with code 0')
expect.stringContaining('[0] node fixtures/sleep.mjs 0.5 exited with code 0'),
);
});

it('kills on failure', async () => {
const lines = await run(
'--kill-others-on-fail "node fixtures/sleep.mjs 10" "exit 1"'
'--kill-others-on-fail "node fixtures/sleep.mjs 10" "exit 1"',
).getLogLines();

expect(lines).toContainEqual(expect.stringContaining('[1] exit 1 exited with code 1'));
expect(lines).toContainEqual(expect.stringContaining('Sending SIGTERM to other processes'));
expect(lines).toContainEqual(
expect.stringMatching(createKillMessage('[0] node fixtures/sleep.mjs 10', 'SIGTERM'))
expect.stringMatching(createKillMessage('[0] node fixtures/sleep.mjs 10', 'SIGTERM')),
);
});
});
Expand All @@ -365,14 +365,14 @@ describe('--handle-input', () => {
expect(exit.code).toBe(0);
expect(lines).toContainEqual(expect.stringContaining('[0] stop'));
expect(lines).toContainEqual(
expect.stringContaining('[0] node fixtures/read-echo.js exited with code 0')
expect.stringContaining('[0] node fixtures/read-echo.js exited with code 0'),
);
});
});

it('forwards input to process --default-input-target', async () => {
const child = run(
'-ki --default-input-target 1 "node fixtures/read-echo.js" "node fixtures/read-echo.js"'
'-ki --default-input-target 1 "node fixtures/read-echo.js" "node fixtures/read-echo.js"',
);
child.log.subscribe((line) => {
if (/\[1\] READING/.test(line)) {
Expand All @@ -385,7 +385,7 @@ describe('--handle-input', () => {
expect(exit.code).toBeGreaterThan(0);
expect(lines).toContainEqual(expect.stringContaining('[1] stop'));
expect(lines).toContainEqual(
expect.stringMatching(createKillMessage('[0] node fixtures/read-echo.js', 'SIGTERM'))
expect.stringMatching(createKillMessage('[0] node fixtures/read-echo.js', 'SIGTERM')),
);
});

Expand All @@ -402,7 +402,7 @@ describe('--handle-input', () => {
expect(exit.code).toBeGreaterThan(0);
expect(lines).toContainEqual(expect.stringContaining('[1] stop'));
expect(lines).toContainEqual(
expect.stringMatching(createKillMessage('[0] node fixtures/read-echo.js', 'SIGTERM'))
expect.stringMatching(createKillMessage('[0] node fixtures/read-echo.js', 'SIGTERM')),
);
});
});
Expand All @@ -411,12 +411,12 @@ describe('--timings', () => {
const defaultTimestampFormatRegex = /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}/;
const processStartedMessageRegex = (index: number, command: string) => {
return new RegExp(
`^\\[${index}] ${command} started at ${defaultTimestampFormatRegex.source}$`
`^\\[${index}] ${command} started at ${defaultTimestampFormatRegex.source}$`,
);
};
const processStoppedMessageRegex = (index: number, command: string) => {
return new RegExp(
`^\\[${index}] ${command} stopped at ${defaultTimestampFormatRegex.source} after (\\d|,)+ms$`
`^\\[${index}] ${command} stopped at ${defaultTimestampFormatRegex.source} after (\\d|,)+ms$`,
);
};

Expand All @@ -430,17 +430,17 @@ describe('--timings', () => {
};
it.each(Object.entries(timingsTests))('%s', async (_, commands) => {
const lines = await run(
`--timings ${commands.map((command) => `"${command}"`).join(' ')}`
`--timings ${commands.map((command) => `"${command}"`).join(' ')}`,
).getLogLines();

// Expect output to contain process start / stop messages for each command
commands.forEach((command, index) => {
const escapedCommand = escapeRegExp(command);
expect(lines).toContainEqual(
expect.stringMatching(processStartedMessageRegex(index, escapedCommand))
expect.stringMatching(processStartedMessageRegex(index, escapedCommand)),
);
expect(lines).toContainEqual(
expect.stringMatching(processStoppedMessageRegex(index, escapedCommand))
expect.stringMatching(processStoppedMessageRegex(index, escapedCommand)),
);
});

Expand Down
6 changes: 3 additions & 3 deletions bin/concurrently.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const args = yargs(argsBeforeSep)
})
.group(
['m', 'n', 'name-separator', 's', 'r', 'no-color', 'hide', 'g', 'timings', 'P'],
'General'
'General',
)
.group(['p', 'c', 'l', 't'], 'Prefix styling')
.group(['i', 'default-input-target'], 'Input handling')
Expand Down Expand Up @@ -229,8 +229,8 @@ concurrently(
timestampFormat: args.timestampFormat,
timings: args.timings,
additionalArguments: args.passthroughArguments ? argsAfterSep : undefined,
}
},
).result.then(
() => process.exit(0),
() => process.exit(1)
() => process.exit(1),
);
2 changes: 1 addition & 1 deletion bin/epilogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const examplesString = examples
.split('\n')
.map((line) => ` ${line}`)
.join('\n'),
].join('\n\n')
].join('\n\n'),
)
.join('\n\n');

Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,33 @@
},
"devDependencies": {
"@hirez_io/observer-spy": "^2.2.0",
"@swc/core": "^1.3.66",
"@swc/jest": "^0.2.26",
"@types/jest": "^29.5.2",
"@types/lodash": "^4.14.195",
"@types/node": "^14.18.51",
"@swc/core": "^1.3.78",
"@swc/jest": "^0.2.29",
"@types/jest": "^29.5.3",
"@types/lodash": "^4.14.197",
"@types/node": "^14.18.54",
"@types/shell-quote": "^1.7.1",
"@types/supports-color": "^8.1.1",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"coveralls-next": "^4.2.0",
"ctrlc-wrapper": "^0.0.4",
"esbuild": "~0.18.7",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-prettier": "^4.2.1",
"esbuild": "~0.19.2",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest": "^29.6.3",
"jest-create-mock-instance": "^2.0.0",
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"lint-staged": "^13.3.0",
"prettier": "^3.0.2",
"safe-publish-latest": "^2.0.0",
"string-argv": "^0.3.2",
"typescript": "~5.1.3"
"typescript": "~5.1.6"
},
"files": [
"dist",
Expand Down
Loading

0 comments on commit ac6265d

Please sign in to comment.