mirror of
https://github.com/hanzoai/jest.git
synced 2026-09-24 16:59:57 +00:00
33 lines
785 B
TypeScript
33 lines
785 B
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
import {extractSummary} from '../Utils';
|
|
import runJest from '../runJest';
|
|
|
|
test('works with custom matchers', () => {
|
|
const {stderr} = runJest('custom-matcher-stack-trace', ['sync.test.js']);
|
|
|
|
let {rest} = extractSummary(stderr);
|
|
|
|
rest = rest
|
|
.split('\n')
|
|
.filter(line => !line.includes('at Error (native)'))
|
|
.join('\n');
|
|
|
|
expect(rest).toMatchSnapshot();
|
|
});
|
|
|
|
test('custom async matchers', () => {
|
|
const {stderr} = runJest('custom-matcher-stack-trace', [
|
|
'asynchronous.test.js',
|
|
]);
|
|
|
|
const {rest} = extractSummary(stderr);
|
|
|
|
expect(rest).toMatchSnapshot();
|
|
});
|