Skip to content

Commit

Permalink
fix: Improve placement of $FlowExpectedErrors (#4559)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Dec 19, 2023
1 parent 3381fb8 commit 87f1dca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Expand Up @@ -4,5 +4,5 @@ import '@babel/polyfill';
// This should fail but couldn't make it to do so
import defaultValue from '@babel/polyfill';

// $FlowExpectedError does not export anything
// $FlowExpectedError[missing-export] does not export anything
import { namedExport } from '@babel/polyfill';
Expand Up @@ -4,5 +4,5 @@ import '@babel/polyfill';
// This should fail but couldn't make it to do so
import defaultValue from '@babel/polyfill';

// $FlowExpectedError does not export anything
// $FlowExpectedError[missing-export] does not export anything
import { namedExport } from '@babel/polyfill';
Expand Up @@ -3,7 +3,7 @@ import { describe, it } from 'flow-typed-test';

describe('unknown properties', () => {
it('are not allowed', () => {
// $FlowExpectedError does not accept unknown props
// $FlowExpectedError[prop-missing] does not accept unknown props
require('@babel/register')({
unknown: 'property'
});
Expand All @@ -20,14 +20,12 @@ describe('plugins', () => {
});
});
it('does not accept anything else', () => {
// $FlowExpectedError no numbers
require('@babel/register')({
plugins: [
123
]
// $FlowExpectedError[incompatible-call] no numbers
plugins: [123]
});
// $FlowExpectedError should be array
require('@babel/register')({
// $FlowExpectedError[incompatible-call] should be array
plugins: 'my-plugin'
});
})
Expand Down

0 comments on commit 87f1dca

Please sign in to comment.