diff --git a/src/about/AboutDialog.tsx b/src/about/AboutDialog.tsx index 1f45c259..725e5e4f 100644 --- a/src/about/AboutDialog.tsx +++ b/src/about/AboutDialog.tsx @@ -29,6 +29,7 @@ const AboutDialog: React.VoidFunctionComponent = ({ }) => { const [isLicenseDialogOpen, setIsLicenseDialogOpen] = useState(false); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/editor/Editor.tsx b/src/editor/Editor.tsx index cde23d4b..129e9739 100644 --- a/src/editor/Editor.tsx +++ b/src/editor/Editor.tsx @@ -141,6 +141,7 @@ const Editor: React.VoidFunctionComponent = ({ onEditorChanged }) = const [editor, setEditor] = useState(null); const { isDarkMode } = useTernaryDarkMode(); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/explorer/Explorer.tsx b/src/explorer/Explorer.tsx index cdbc5bf8..d7b2b29a 100644 --- a/src/explorer/Explorer.tsx +++ b/src/explorer/Explorer.tsx @@ -371,6 +371,7 @@ const FileTree: React.VoidFunctionComponent = ({ i18n }) => { }; const Explorer: React.VFC = () => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/explorer/fileNameFormGroup/FileNameFormGroup.tsx b/src/explorer/fileNameFormGroup/FileNameFormGroup.tsx index cc543960..98af1a8e 100644 --- a/src/explorer/fileNameFormGroup/FileNameFormGroup.tsx +++ b/src/explorer/fileNameFormGroup/FileNameFormGroup.tsx @@ -78,6 +78,7 @@ const FileNameFormGroup: React.VoidFunctionComponent = ( inputRef, onChange, }) => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); const fileNameIntent = diff --git a/src/explorer/newFileWizard/NewFileWizard.tsx b/src/explorer/newFileWizard/NewFileWizard.tsx index a89f7280..9ab5323f 100644 --- a/src/explorer/newFileWizard/NewFileWizard.tsx +++ b/src/explorer/newFileWizard/NewFileWizard.tsx @@ -36,6 +36,7 @@ const NewFileWizard: React.VoidFunctionComponent = ({ isOpen, onClose, }) => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); const dispatch = useDispatch(); diff --git a/src/explorer/renameFileDialog/RenameFileDialog.tsx b/src/explorer/renameFileDialog/RenameFileDialog.tsx index de4ce7e7..d226e869 100644 --- a/src/explorer/renameFileDialog/RenameFileDialog.tsx +++ b/src/explorer/renameFileDialog/RenameFileDialog.tsx @@ -15,10 +15,11 @@ import { renameFileDialogDidAccept, renameFileDialogDidCancel } from './actions' import { I18nId } from './i18n'; const RenameFileDialog: React.VFC = () => { + // istanbul ignore next: babel-loader rewrites this line + const [i18n] = useI18n(); const dispatch = useDispatch(); const isOpen = useSelector((s) => s.explorer.renameFileDialog.isOpen); const oldName = useSelector((s) => s.explorer.renameFileDialog.fileName); - const [i18n] = useI18n(); const [baseName, extension] = oldName.split(/(\.\w+)$/); diff --git a/src/licenses/LicenseDialog.tsx b/src/licenses/LicenseDialog.tsx index 8481f4ea..4ced5aa8 100644 --- a/src/licenses/LicenseDialog.tsx +++ b/src/licenses/LicenseDialog.tsx @@ -183,6 +183,7 @@ const LicenseDialog: React.VoidFunctionComponent = ({ const [licenseInfo, setLicenseInfo] = useState(undefined); const infoDiv = React.useRef(null); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/notifications/NotificationAction.tsx b/src/notifications/NotificationAction.tsx index cd2fbff9..f6f7893b 100644 --- a/src/notifications/NotificationAction.tsx +++ b/src/notifications/NotificationAction.tsx @@ -16,6 +16,7 @@ const NotificationAction: React.VoidFunctionComponent = messageId, replacements, }) => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return <>{i18n.translate(messageId, replacements)}; diff --git a/src/notifications/NotificationMessage.tsx b/src/notifications/NotificationMessage.tsx index d6a6a0ca..da5b8167 100644 --- a/src/notifications/NotificationMessage.tsx +++ b/src/notifications/NotificationMessage.tsx @@ -16,6 +16,7 @@ const NotificationMessage: React.VoidFunctionComponent messageId, replacements, }) => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); let message = i18n.translate(messageId, replacements) as diff --git a/src/notifications/UnexpectedErrorNotification.tsx b/src/notifications/UnexpectedErrorNotification.tsx index 06a47208..62b90207 100644 --- a/src/notifications/UnexpectedErrorNotification.tsx +++ b/src/notifications/UnexpectedErrorNotification.tsx @@ -16,6 +16,7 @@ type UnexpectedErrorNotificationProps = { const UnexpectedErrorNotification: React.VoidFunctionComponent< UnexpectedErrorNotificationProps > = ({ messageId, err }) => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/settings/SettingsDrawer.tsx b/src/settings/SettingsDrawer.tsx index 59122527..021f630e 100644 --- a/src/settings/SettingsDrawer.tsx +++ b/src/settings/SettingsDrawer.tsx @@ -76,6 +76,7 @@ const SettingsDrawer: React.VoidFunctionComponent = ({ const dispatch = useDispatch(); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); const hotkeys = useMemo( diff --git a/src/status-bar/StatusBar.tsx b/src/status-bar/StatusBar.tsx index 5115eb64..2729ec80 100644 --- a/src/status-bar/StatusBar.tsx +++ b/src/status-bar/StatusBar.tsx @@ -107,9 +107,11 @@ const BatteryIndicator: React.VoidFunctionComponent = ({ }; const StatusBar: React.VFC = (_props) => { - const connection = useSelector((s) => s.ble.connection); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); + const connection = useSelector((s) => s.ble.connection); + return (
JSX.Element { const contextMenu = (_props: ContextMenu2ContentProps): JSX.Element => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/toolbar/buttons/bluetooth/BluetoothButton.tsx b/src/toolbar/buttons/bluetooth/BluetoothButton.tsx index d70733cb..2b3b9130 100644 --- a/src/toolbar/buttons/bluetooth/BluetoothButton.tsx +++ b/src/toolbar/buttons/bluetooth/BluetoothButton.tsx @@ -21,8 +21,9 @@ const BluetoothButton: React.VFC = () => { bootloaderConnection === BootloaderConnectionState.Disconnected && bleConnection === BleConnectionState.Disconnected; - const dispatch = useDispatch(); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); + const dispatch = useDispatch(); return ( { const [isSettingFlashCurrentProgramEnabled] = useSettingFlashCurrentProgram(); const { hubName } = useSettingHubName(); - const dispatch = useDispatch(); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); + const dispatch = useDispatch(); return ( { - const enabled = useSelector((s) => s.hub.runtime === HubRuntimeState.Idle); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); const dispatch = useDispatch(); + + const enabled = useSelector((s) => s.hub.runtime === HubRuntimeState.Idle); const action = useCallback(() => dispatch(repl()), [dispatch]); return ( diff --git a/src/toolbar/buttons/run/RunButton.tsx b/src/toolbar/buttons/run/RunButton.tsx index 44a5661e..7bde736f 100644 --- a/src/toolbar/buttons/run/RunButton.tsx +++ b/src/toolbar/buttons/run/RunButton.tsx @@ -20,8 +20,9 @@ const RunButton: React.VFC = () => { const hasEditor = useSelector((s) => s.app.hasEditor); const keyboardShortcut = 'F5'; - const dispatch = useDispatch(); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); + const dispatch = useDispatch(); return ( ; const SettingsButton: React.VoidFunctionComponent = ({ onAction, }) => { + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( diff --git a/src/toolbar/buttons/stop/StopButton.tsx b/src/toolbar/buttons/stop/StopButton.tsx index 04eb3af0..e430f6a0 100644 --- a/src/toolbar/buttons/stop/StopButton.tsx +++ b/src/toolbar/buttons/stop/StopButton.tsx @@ -15,8 +15,9 @@ const StopButton: React.VFC = () => { const runtime = useSelector((s) => s.hub.runtime); const keyboardShortcut = 'F6'; - const dispatch = useDispatch(); + // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); + const dispatch = useDispatch(); return (