Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nova-react-test-utils): replace default imports with * imports #120

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions change/@nova-react-f0f39448-a25c-42e0-a43f-ffbc21cef7de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "change to * as imports",
"packageName": "@nova/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "change to * as imports",
"packageName": "@nova/react-test-utils",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion packages/nova-react-test-utils/src/apollo/test-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import * as React from "react";
import { ApolloProvider } from "@apollo/client";
import type { GraphQLSchema } from "graphql";
import type { MockFunctions } from "@graphitation/apollo-mock-client";
Expand Down
2 changes: 1 addition & 1 deletion packages/nova-react-test-utils/src/apollo/utils.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import * as React from "react";
import { buildASTSchema, parse } from "graphql";
import type { ReactTestRenderer } from "react-test-renderer";
import { act, create as createTestRenderer } from "react-test-renderer";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import * as React from "react";
import type { ComponentType, PropsWithChildren } from "react";
import type {
NovaCentralizedCommanding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @jest-environment jsdom
*/

import React from "react";
import * as React from "react";
import { render } from "@testing-library/react";
import {
NovaCentralizedCommandingProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import * as React from "react";
import type { NovaCentralizedCommanding } from "@nova/types";
import invariant from "invariant";
import * as invariant from "invariant";

// Initializing default with null to make sure providers are correctly placed in the tree
const NovaCommandingContext =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @jest-environment jsdom
*/

import React from "react";
import * as React from "react";
import { render, waitFor } from "@testing-library/react";
import type {
GeneratedEventWrapper,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import type { NovaEvent, NovaEventing, EventWrapper } from "@nova/types";
import { InputType } from "@nova/types";
import invariant from "invariant";
import * as invariant from "invariant";

// Context is initialized with an empty object and this is null-checked within the hooks
const NovaEventingContext = React.createContext<INovaEventingContext>({});
Expand Down
2 changes: 1 addition & 1 deletion packages/nova-react/src/graphql/hooks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @jest-environment jsdom
*/

import React from "react";
import * as React from "react";
import { render, screen, renderHook } from "@testing-library/react";

import { NovaGraphQLProvider } from "./nova-graphql-provider";
Expand Down
4 changes: 2 additions & 2 deletions packages/nova-react/src/graphql/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNovaGraphQL } from "./nova-graphql-provider";
import invariant from "invariant";
import * as invariant from "invariant";

import type { GraphQLTaggedNode } from "./taggedNode";
import type {
Expand All @@ -8,7 +8,7 @@ import type {
OperationType,
PaginationFn,
RefetchFn,
FetchPolicy
FetchPolicy,
} from "./types";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @jest-environment jsdom
*/

import React from "react";
import * as React from "react";
import type { NovaGraphQL } from "@nova/types";
import { render } from "@testing-library/react";
import { NovaGraphQLProvider, useNovaGraphQL } from "./nova-graphql-provider";
Expand Down
4 changes: 2 additions & 2 deletions packages/nova-react/src/graphql/nova-graphql-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import * as React from "react";
import type { NovaGraphQL } from "@nova/types";
import invariant from "invariant";
import * as invariant from "invariant";

// Initializing default with null to make sure providers are correctly placed in the tree
const NovaGraphQLContext = React.createContext<NovaGraphQL | null>(null);
Expand Down
2 changes: 1 addition & 1 deletion scripts/config/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from "path";
import * as path from "path";

export default {
preset: "ts-jest",
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"declarationMap": true,
"strict": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"forceConsistentCasingInFileNames": true,
}
Expand Down
Loading