/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
e2e/__tests__/resolveNoFileExtensions.test.ts
55 строк
1 KB
Simen Bekkhus
chore: replace line numbers in snapshots (#16079)
02 май 2026, 00:22
Не верифицирован
02 май 2026, 00:22
fe708d8
Код
Авторство
О чём код?
/** * 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 * as path from 'path'; import { cleanup, extractSummary, replaceJestBuildLineNumbers, writeFiles, } from '../Utils'; import runJest from '../runJest'; const DIR = path.resolve(__dirname, '../resolve-no-extensions-no-js'); beforeEach(() => cleanup(DIR)); afterAll(() => cleanup(DIR)); test('show error message with matching files', () => { const {exitCode, stderr} = runJest('resolve-no-extensions'); const {rest} = extractSummary(stderr); expect(exitCode).toBe(1); expect(replaceJestBuildLineNumbers(rest)).toMatchSnapshot(); }); test('show error message when no js moduleFileExtensions', () => { writeFiles(DIR, { 'index.jsx': ` module.exports ={found: true}; `, 'package.json': ` { "jest": { "moduleFileExtensions": ["jsx"] } } `, 'test.jsx': ` const m = require('../'); test('some test', () => { expect(m.found).toBe(true); }); `, }); const {exitCode, stderr} = runJest('resolve-no-extensions-no-js'); expect(exitCode).toBe(1); expect(stderr).toMatchSnapshot(); });