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

Adds MSW + testing utilities example #11763

Closed
wants to merge 14 commits into from
Closed
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ workflows:
- dual-module-test-standard
- vite
- vite-swc
- vite-jest-msw
# -browser-esm would need a package publish to npm/CDNs
- TestPeerDepTypes:
name: Test external types for << matrix.externalPackage >>
Expand Down
30,040 changes: 19,335 additions & 10,705 deletions integration-tests/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"next",
"vite",
"vite-swc",
"vite-jest-msw",
"node-standard",
"node-esm",
"shared"
Expand Down
11 changes: 11 additions & 0 deletions integration-tests/vite-jest-msw/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }],
["@babel/preset-react", { "runtime": "automatic" }],
"@babel/preset-typescript"
],
"plugins": [
["inline-json-import", {}],
"@babel/plugin-proposal-explicit-resource-management"
]
}
6 changes: 6 additions & 0 deletions integration-tests/vite-jest-msw/@types/graphql.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module "*.graphql" {
import { DocumentNode } from "graphql";
const Schema: DocumentNode;

export = Schema;
}
13 changes: 13 additions & 0 deletions integration-tests/vite-jest-msw/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions integration-tests/vite-jest-msw/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const config = {
globals: {
"globalThis.__DEV__": JSON.stringify(true),
},
testEnvironment: "jsdom",
setupFiles: ["./tests/jest.polyfills.js"],
setupFilesAfterEnv: ["./tests/setupTests.js"],
transform: {
"\\.(gql|graphql)$": "@graphql-tools/jest-transform",
".*": "babel-jest",
},
testEnvironmentOptions: {
customExportConditions: [""],
},
};

export default config;
Loading
Loading