瀏覽代碼

Fix test module imports

Andrew Swistak 6 年之前
父節點
當前提交
77561fb865
共有 2 個文件被更改,包括 9 次插入19 次删除
  1. 2 8
      spec/javascript/frontend/components/pages/pokemon/Show.test.tsx
  2. 7 11
      tsconfig.json

+ 2 - 8
spec/javascript/frontend/components/pages/pokemon/Show.test.tsx

@@ -4,14 +4,8 @@ import {createMockEnvironment, MockPayloadGenerator} from 'relay-test-utils';
 import {QueryRenderer, graphql} from 'react-relay';
 import * as ReactTestRenderer from 'react-test-renderer';
 
-// FIXME: imports in this manner work fine via `yarn test` but fails in-editor for code completion
-//import FragmentedPokemonShow, {PokemonShow, Props} from 'packs/frontend/components/pages/pokemon/Show';
-//import {Show_pokemon} from 'packs/frontend/components/pages/pokemon/__generated__/Show_pokemon.graphql';
-import FragmentedPokemonShow, {
-  PokemonShow,
-  Props,
-} from '../../../../../../app/javascript/packs/frontend/components/pages/pokemon/Show';
-import {Show_pokemon} from '../../../../../../app/javascript/packs/frontend/components/pages/pokemon/__generated__/Show_pokemon.graphql';
+import FragmentedPokemonShow, {PokemonShow, Props} from 'packs/frontend/components/pages/pokemon/Show';
+import {Show_pokemon} from 'packs/frontend/components/pages/pokemon/__generated__/Show_pokemon.graphql';
 
 const pokemon: Show_pokemon = {
   id: '1',

+ 7 - 11
tsconfig.json

@@ -2,20 +2,16 @@
   "compilerOptions": {
     "allowSyntheticDefaultImports": true,
     "declaration": false,
-    "emitDecoratorMetadata": true,
-    "experimentalDecorators": true,
     "jsx": "react",
-    "lib": ["es6", "dom"],
-    "module": "esNext",
-    "moduleResolution": "node",
-    "target": "esNext",
-    "baseUrl": "./app/javascript"
+    "lib": ["ESNext", "dom"],
+    "module": "ESNext",
+    "moduleResolution": "Node",
+    "target": "ESNext",
+    "strict": false,
+    "baseUrl": "app/javascript"
   },
+
   "exclude": [
-    "**/*.test.ts",
-    "**/*.test.tsx",
-    "**/*.test.js",
-    "**/*.test.jsx",
     "node_modules",
     "vendor",
     "public"