@fullstory/browser 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/index.test.ts +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstory/browser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "The official FullStory browser SDK",
|
|
5
5
|
"repository": "git://github.com/fullstorydev/fullstory-browser-sdk.git",
|
|
6
6
|
"homepage": "https://github.com/fullstorydev/fullstory-browser-sdk",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"sdk"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@fullstory/snippet": "2.0.
|
|
29
|
+
"@fullstory/snippet": "2.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.8.7",
|
package/src/index.test.ts
CHANGED
|
@@ -151,6 +151,16 @@ describe('typescript safety', () => {
|
|
|
151
151
|
// @ts-expect-error (for testing purposes)
|
|
152
152
|
FS('observe', { type: '🦂', callback: () => console.log('STARTED') });
|
|
153
153
|
|
|
154
|
+
// Disconnector can be `void` type
|
|
155
|
+
const disconnector = FS('observe', { type: 'start', callback: () => console.log('STARTED') });
|
|
156
|
+
|
|
157
|
+
// README(scottnorvell): statements where we _don't_ null check the disconnector
|
|
158
|
+
// work in the editor but not on CI so I got rid of them 🤷♂️
|
|
159
|
+
if (disconnector) {
|
|
160
|
+
// passes
|
|
161
|
+
disconnector.disconnect();
|
|
162
|
+
}
|
|
163
|
+
|
|
154
164
|
// LEGACY:
|
|
155
165
|
// Passes TypeScript check
|
|
156
166
|
FS.setVars('user', { email: 'e@mail.com' });
|
|
@@ -169,4 +179,17 @@ describe('typescript safety', () => {
|
|
|
169
179
|
// Assertion for posterity's sake...
|
|
170
180
|
expect(true).to.equal(true);
|
|
171
181
|
});
|
|
182
|
+
|
|
183
|
+
// NOTE: don't run this test, it will hang since fs.js isn't really running. It's only for typescript safety checks.
|
|
184
|
+
xit('provides type assistance for the async api', async () => {
|
|
185
|
+
init({ orgId: testOrg });
|
|
186
|
+
|
|
187
|
+
const disconnector = await FS('observeAsync', { type: 'start', callback: () => console.log('STARTED') });
|
|
188
|
+
|
|
189
|
+
disconnector.disconnect();
|
|
190
|
+
|
|
191
|
+
const url = await FS('getSessionAsync');
|
|
192
|
+
|
|
193
|
+
console.log(url.trim());
|
|
194
|
+
});
|
|
172
195
|
});
|