From 77d36729f736d903ccbc173713a24d074cbb3866 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 2 Jun 2022 09:44:12 +0100 Subject: [PATCH] Fix npm run test. Update import as import type. Replace script - flow with just flow (removing if statement). Adding ignore script for malformed node_modules file --- .flowconfig | 1 + __mocks__/genInteractives.js | 7 +++++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.flowconfig b/.flowconfig index 11145d7b2..46e35fd4e 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,4 +1,5 @@ [ignore] +/node_modules/resolve/test/resolver/malformed_package_json/package.json /lib/.* /docs/.* /reports/.* diff --git a/__mocks__/genInteractives.js b/__mocks__/genInteractives.js index 927321b75..0f1ef30b8 100644 --- a/__mocks__/genInteractives.js +++ b/__mocks__/genInteractives.js @@ -4,8 +4,11 @@ import { dom, roles } from 'aria-query'; import includes from 'array-includes'; -import JSXAttributeMock, { JSXAttributeMockType } from './JSXAttributeMock'; -import JSXElementMock, { JSXElementMockType } from './JSXElementMock'; +import JSXAttributeMock from './JSXAttributeMock'; +import JSXElementMock from './JSXElementMock'; + +import type { JSXAttributeMockType } from './JSXAttributeMock'; +import type { JSXElementMockType } from './JSXElementMock'; const domElements = [...dom.keys()]; const roleNames = [...roles.keys()]; diff --git a/package.json b/package.json index 897c7cd64..dd7a5f420 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "scripts": { "build": "rimraf lib && babel src --out-dir lib --copy-files", "create": "node ./scripts/create-rule", - "flow": "if [ ! -e ./.flowconfig ]; then echo \"Could not find .flowconfig\"; else flow; test $? -eq 0 -o $? -eq 2; fi", + "flow": "flow", "lint:fix": "npm run lint -- --fix", "lint": "eslint .", "prepublish": "not-in-publish || npm run prepublishOnly",