Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Jul 27, 2023
1 parent cdadafe commit 81d5d97
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion __e2e__/buildTestBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function buildTestBundle() {
filename,
},
resolve: {
mainFields: ['main', 'browser'],
mainFields: ['react-native', 'main', 'browser'],
},
}).run(resolve)
})
Expand Down
22 changes: 12 additions & 10 deletions __e2e__/fixture/apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ const client = new ApolloClient({
cache: new InMemoryCache(),
})

client.query({
query: gql`
query ExampleQuery {
company {
name
ceo
employees
export default async function run() {
return client.query({
query: gql`
query ExampleQuery {
company {
name
ceo
employees
}
}
}
`,
})
`,
})
}
8 changes: 5 additions & 3 deletions __e2e__/fixture/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import './setup'

import runXHRTest from './xhr-test' // Install fetch polyfill before initial apollo-client
import runApolloTest from './apollo'
import runReduxTest from './redux'
import runMobXTest from './mobx'
import runRemoteDevTest from './remotedev'
import runXHRTest from './xhr-test'
import './apollo'

runReduxTest()
runMobXTest()
runRemoteDevTest()
runXHRTest()
runApolloTest().catch((e) => console.error(e))
runXHRTest().catch((e) => console.error(e))
4 changes: 2 additions & 2 deletions __e2e__/fixture/xhr-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'whatwg-fetch'

export default function run() {
export default async function run() {
// Fetch with forbidden header names
fetch('http://localhost:8099', {
await fetch('http://localhost:8099', {
headers: {
Origin: 'custom_origin_here',
'User-Agent': 'react-native',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"webpack-bundle-analyzer": "^4.9.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"whatwg-fetch": "^2.0.3",
"whatwg-fetch": "^3.6.17",
"ws": "^7.5.9"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12023,10 +12023,10 @@ websocket-extensions@>=0.1.1:
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==

whatwg-fetch@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"
integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==
whatwg-fetch@^3.6.17:
version "3.6.17"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.17.tgz#009bbbfc122b227b74ba1ff31536b3a1a0e0e212"
integrity sha512-c4ghIvG6th0eudYwKZY5keb81wtFz9/WeAHAoy8+r18kcWlitUIrmGFQ2rWEl4UCKUilD3zCLHOIPheHx5ypRQ==

whatwg-url@^5.0.0:
version "5.0.0"
Expand Down

0 comments on commit 81d5d97

Please sign in to comment.