Skip to content

Commit 59cf055

Browse files
committed
eslint
1 parent 24bd16d commit 59cf055

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

packages/jest-core/src/lib/__tests__/serializeToJSON.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ import serializeToJSON from '../serializeToJSON';
99

1010
// populate an object with all basic JavaScript datatypes
1111
const object = {
12-
species: 'capybara',
13-
ok: true,
14-
i: ['pull up'],
12+
chillness: 100,
13+
flaws: null,
1514
hopOut: {
1615
atThe: 'after party',
1716
when: new Date('2000-07-14'),
1817
},
19-
chillness: 100,
20-
weight: 9.5,
21-
flaws: null,
18+
i: ['pull up'],
2219
location: undefined,
20+
ok: true,
21+
species: 'capybara',
22+
weight: 9.5,
2323
};
2424

2525
it('serializes regular objects like JSON.stringify', () => {
@@ -36,9 +36,9 @@ it('serializes errors', () => {
3636

3737
expect(withoutError).not.toEqual(withError);
3838

39-
expect(withError).toContain(`"message":"too cool"`);
40-
expect(withError).toContain(`"name":"Error"`);
41-
expect(withError).toContain(`"stack":"Error:`);
39+
expect(withError).toContain('"message":"too cool"');
40+
expect(withError).toContain('"name":"Error"');
41+
expect(withError).toContain('"stack":"Error:');
4242

4343
expect(JSON.parse(withError)).toMatchObject({
4444
error: {

packages/jest-core/src/lib/serializeToJSON.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* This function handles the extended serialization wanted above.
1414
*/
1515
export default function serializeToJSON(
16-
value: any,
16+
value: unknown,
1717
space?: string | number,
1818
): string {
1919
return JSON.stringify(

packages/jest-core/src/runJest.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ import collectNodeHandles, {
3333
type HandleCollectionResult,
3434
} from './collectHandles';
3535
import getNoTestsFoundMessage from './getNoTestsFoundMessage';
36+
import serializeToJSON from './lib/serializeToJSON';
3637
import runGlobalHook from './runGlobalHook';
3738
import type {Filter, TestRunData} from './types';
38-
import serializeToJSON from './lib/serializeToJSON';
3939

4040
const getTestPaths = async (
4141
globalConfig: Config.GlobalConfig,
@@ -117,17 +117,12 @@ const processResults = async (
117117
const cwd = tryRealpath(process.cwd());
118118
const filePath = path.resolve(cwd, outputFile);
119119

120-
fs.writeFileSync(
121-
filePath,
122-
`${jsonString}\n`,
123-
);
120+
fs.writeFileSync(filePath, `${jsonString}\n`);
124121
outputStream.write(
125122
`Test results written to: ${path.relative(cwd, filePath)}\n`,
126123
);
127124
} else {
128-
process.stdout.write(
129-
`${jsonString}\n`,
130-
);
125+
process.stdout.write(`${jsonString}\n`);
131126
}
132127
}
133128

0 commit comments

Comments
 (0)