Skip to content

Commit 7edc18d

Browse files
committed
Fix error message for sl (steam locomotive)
When running jest in watch mode, with `sl` installed (https://github.com/mtoyoda/sl), it errors out with the following message: ``` ● Test suite failed to run thrown: [Error] ``` This is bad because the error is extremely hard to debug. This change makes it error as follows: ``` ● Test suite failed to run Command failed with ENAMETOOLONG: sl status -amnu /Users/rmartine/dev/ias-backstage/packages/backend spawn ENAMETOOLONG ``` This, at least, points people in the right direction. See also: #14046
1 parent 654dbd6 commit 7edc18d

File tree

1 file changed

+1
-14
lines changed
  • packages/jest-changed-files/src

1 file changed

+1
-14
lines changed

packages/jest-changed-files/src/sl.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import * as path from 'path';
10-
import {types} from 'util';
1110
import execa = require('execa');
1211
import type {SCMAdapter} from './types';
1312

@@ -34,19 +33,7 @@ const adapter: SCMAdapter = {
3433
}
3534
args.push(...includePaths);
3635

37-
let result: execa.ExecaReturnValue;
38-
39-
try {
40-
result = await execa('sl', args, {cwd, env});
41-
} catch (error) {
42-
if (types.isNativeError(error)) {
43-
const err = error as execa.ExecaError;
44-
// TODO: Should we keep the original `message`?
45-
err.message = err.stderr;
46-
}
47-
48-
throw error;
49-
}
36+
const result = await execa('sl', args, {cwd, env});
5037

5138
return result.stdout
5239
.split('\n')

0 commit comments

Comments
 (0)