/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
e2e/__tests__/testPathPatternReporterMessage.test.ts
38 строк
1 KB
Brandon Chinn
Only match relative paths when specifying paths (#12519)
03 окт 2023, 08:56
Не верифицирован
03 окт 2023, 08:56
41133b5
Код
Авторство
О чём код?
/** * 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 {tmpdir} from 'os'; import * as path from 'path'; import {cleanup, writeFiles} from '../Utils'; import runJest from '../runJest'; const DIR = path.resolve(tmpdir(), 'jest-path-pattern-reporter-message'); beforeEach(() => cleanup(DIR)); afterEach(() => cleanup(DIR)); test('prints a message with path pattern at the end', () => { writeFiles(DIR, { '.watchmanconfig': '', '__tests__/a.test.js': "test('a', () => {});", '__tests__/b.test.js': "test('b', () => {});", 'package.json': '{}', }); let stderr; ({stderr} = runJest(DIR, ['a'])); expect(stderr).toMatch('Ran all test suites matching a'); ({stderr} = runJest(DIR, ['a', 'b'])); expect(stderr).toMatch('Ran all test suites matching a|b'); ({stderr} = runJest(DIR, ['--testPathPatterns', 'a'])); expect(stderr).toMatch('Ran all test suites matching a'); ({stderr} = runJest(DIR, ['--testPathPatterns', 'a|b'])); expect(stderr).toMatch('Ran all test suites matching a|b'); });