Skip to content

Commit

Permalink
test(typescript-estree): generate correct snapshots for jsx files (#2992
Browse files Browse the repository at this point in the history
)
  • Loading branch information
armano2 committed Feb 2, 2021
1 parent 58476a9 commit cfb749d
Show file tree
Hide file tree
Showing 73 changed files with 27,542 additions and 246 deletions.
4 changes: 2 additions & 2 deletions packages/typescript-estree/tests/ast-fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'jest-specific-snapshot';
import makeDir from 'make-dir';
import path from 'path';
import { parseAndGenerateServices } from '../src/parser';
import { isJSXFileType } from '../tools/test-utils';

// Assign a segment set to this variable to limit the test to only this segment
// This is super helpful if you need to debug why a specific fixture isn't producing the correct output
Expand All @@ -23,7 +24,6 @@ const FIXTURES_DIR = path.resolve(
);
const SNAPSHOTS_DIR = path.resolve(__dirname, 'snapshots');

const JSX_REGEX = /\.[jt]sx$/;
const fixtures = glob
.sync(`${FIXTURES_DIR}/**/*.src.{js,ts,jsx,tsx}`)
.map(absolute => {
Expand All @@ -33,7 +33,7 @@ const fixtures = glob
const snapshotPath = path.join(SNAPSHOTS_DIR, dir);
return {
absolute,
isJsx: JSX_REGEX.test(name),
isJsx: isJSXFileType(ext),
name,
segments,
snapshotPath,
Expand Down

0 comments on commit cfb749d

Please sign in to comment.