Skip to content

Commit 80f29d4

Browse files
committed
Added data connect test for fetches
1 parent c58a289 commit 80f29d4

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

config/.eslintrc.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@ module.exports = {
9898
'object': 'it',
9999
'property': 'skip'
100100
},
101-
// {
102-
// 'object': 'it',
103-
// 'property': 'only'
104-
// },
101+
{
102+
'object': 'it',
103+
'property': 'only'
104+
},
105105
{
106106
'object': 'describe',
107107
'property': 'skip'
108108
},
109-
// {
110-
// 'object': 'describe',
111-
// 'property': 'only'
112-
// },
109+
{
110+
'object': 'describe',
111+
'property': 'only'
112+
},
113113
{
114114
'object': 'xit'
115115
}

packages/data-connect/test/unit/fetch.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,30 @@ describe('fetch', () => {
220220
}
221221
}
222222
});
223+
it('should call credentials include if using emulator on cloud workstation', async () => {
224+
const json = {
225+
code: 200,
226+
message1: 'success'
227+
};
228+
const fakeFetchImpl = mockFetch(json, false);
229+
await dcFetch(
230+
'https://abc.cloudworkstations.dev',
231+
{
232+
name: 'n',
233+
operationName: 'n',
234+
variables: {}
235+
},
236+
{} as AbortController,
237+
null,
238+
null,
239+
null,
240+
true, // _isUsingGen is true
241+
CallerSdkTypeEnum.Base,
242+
true
243+
);
244+
expect(fakeFetchImpl).to.have.been.calledWithMatch(
245+
'https://abc.cloudworkstations.dev',
246+
{ credentials: 'include' }
247+
);
248+
});
223249
});

0 commit comments

Comments
 (0)