Skip to content

Commit

Permalink
add assertion to type annotation literal espree adapter test
Browse files Browse the repository at this point in the history
Summary: if we're expecting this to fail, we might as well assert that it does

Reviewed By: pieterv

Differential Revision: D45092739

fbshipit-source-id: 10f169d8288e80bed966df4235027b66237473f7
  • Loading branch information
noahlemen authored and facebook-github-bot committed Apr 18, 2023
1 parent 74579f7 commit ba622bc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

import type {AlignmentCase} from '../__test_utils__/alignment-utils';

import {expectBabelAlignment} from '../__test_utils__/alignment-utils';
import {
expectBabelAlignment,
expectEspreeAlignment,
} from '../__test_utils__/alignment-utils';
import {parse, parseForSnapshot} from '../__test_utils__/parse';

describe('Literal', () => {
Expand All @@ -25,7 +28,10 @@ describe('Literal', () => {
type T5 = 4321n;
type T6 = 12_34n;
`,
espree: {expectToFail: false},
espree: {
expectToFail: 'espree-exception',
expectedExceptionMessage: 'Unexpected token T1',
},
babel: {expectToFail: false},
};

Expand Down Expand Up @@ -182,7 +188,7 @@ describe('Literal', () => {
"type": "Program",
}
`);
// types-only so no espree alignment possible
expectEspreeAlignment(testCase);
});

test('Babel', () => {
Expand Down

0 comments on commit ba622bc

Please sign in to comment.