Skip to content

Commit

Permalink
Change compiled source location from "lib" to "dist"
Browse files Browse the repository at this point in the history
  • Loading branch information
hwillson committed Sep 24, 2019
1 parent f973610 commit ef6db11
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = {
testURL: 'http://localhost',
testPathIgnorePatterns: [
'/node_modules/',
'/lib/'
'/dist/'
],
modulePathIgnorePatterns: ['/dist/'],
setupFiles: ['<rootDir>/src/config/jest/setup.ts'],
};
2 changes: 1 addition & 1 deletion config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function prepareESM() {
external,
preserveModules: true,
output: {
dir: './lib',
dir: './dist',
format: 'esm',
sourcemap: true,
},
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/react-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Apollo Client >= 3 includes React testing utilities out of the box. You don't ne
## `MockedProvider`

```js
import { MockedProvider } from "@apollo/client/lib/react/testing";
import { MockedProvider } from "@apollo/client/react/testing";
```

The `MockedProvider` is a test-utility that allows you to create a mocked version of the [`ApolloProvider`](/api/react-hooks/#apolloprovider) that doesn't send out network requests to your API, but rather allows you to specify the exact response payload for a given request.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/hooks-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ npm install @apollo/react-ssr

## Testing

React testing utilities are now available through the Apollo Client project, but they aren't included in the default bundle. To access the React testing utilities, you can use a cherry-pick import from `@apollo/client/lib/react/testing` like:
React testing utilities are now available through the Apollo Client project, but they aren't included in the default bundle. To access the React testing utilities, you can use a cherry-pick import from `@apollo/client/react/testing` like:

```
import { MockedProvider } from '@apollo/client/lib/react/testing';
import { MockedProvider } from '@apollo/client/react/testing';
```
4 changes: 2 additions & 2 deletions docs/source/recipes/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Apollo Client's React integration relies on [React's context](https://reactjs.or

This guide will explain step-by-step how to test Apollo Client React code. The following examples use the [Jest](https://facebook.github.io/jest/docs/en/tutorial-react.html) testing framework, but most concepts should be reusable with other libraries. These examples aim to use as simple of a toolset as possible, so React's [test renderer](https://reactjs.org/docs/test-renderer.html) will be used in place of React-specific tools like [Enzyme](https://github.com/airbnb/enzyme) and [react-testing-library](https://github.com/kentcdodds/react-testing-library).

> **Note:** As of Apollo Client 3, all testing utilities can now be imported from `@apollo/client/lib/react/testing`.
> **Note:** As of Apollo Client 3, all testing utilities can now be imported from `@apollo/client/react/testing`.
Consider the component below, which makes a basic query, and displays its results:

Expand Down Expand Up @@ -131,7 +131,7 @@ Here's an example of a test for the above `Dog` component using `MockedProvider`
```jsx
// dog.test.js

import { MockedProvider } from '@apollo/client/lib/react/testing';
import { MockedProvider } from '@apollo/client/react/testing';

// The component AND the query need to be exported
import { GET_DOG_QUERY, Dog } from './dog';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"target": "es5",
"module": "es2015",
"esModuleInterop": true,
"outDir": "./lib",
"outDir": "./dist",
"lib": ["es2015", "esnext.asynciterable", "dom"],
"jsx": "react"
},
Expand Down

0 comments on commit ef6db11

Please sign in to comment.