Skip to content

Commit f977fd6

Browse files
committed
Switched to using NPM Versions of FDC3
2 parents 501247d + fb2967a commit f977fd6

File tree

6 files changed

+43
-39
lines changed

6 files changed

+43
-39
lines changed

package-lock.json

Lines changed: 28 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/common/fdc3.app-channels.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { APP_CHANNEL_AND_BROADCAST, APP_CHANNEL_AND_BROADCAST_TWICE, ChannelCont
55

66
export function createAppChannelTests(cc: ChannelControl<any, any, any>, documentation: string, prefix: string): Mocha.Suite {
77
return describe("App channels", () => {
8-
beforeEach(cc.leaveChannel);
8+
beforeEach(async () => cc.leaveChannel());
99

1010
afterEach(async function afterEach() {
1111
await cc.closeMockApp(this.currentTest.title);
@@ -167,7 +167,7 @@ export function createAppChannelTests(cc: ChannelControl<any, any, any>, documen
167167
}
168168
}
169169
} finally {
170-
cc.unsubscribeListeners([listener,listener2]);
170+
cc.unsubscribeListeners([listener, listener2]);
171171
}
172172
});
173173

src/test/common/fdc3.user-channels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import constants from "../../constants";
77
export function createUserChannelTests(cc: ChannelControl<any, any, any>, documentation: string, prefix: string): Mocha.Suite {
88
const channelName = prefix === "" ? "System channels" : "User channels";
99
return describe(channelName, () => {
10-
beforeEach(cc.leaveChannel);
10+
beforeEach(async () => cc.leaveChannel());
1111

1212
afterEach(async function afterEach() {
1313
if (this.currentTest.title !== UCFilteredUsageJoin) await cc.closeMockApp(this.currentTest.title);

src/test/v1.2/fdc3-1_2-utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ declare let fdc3: DesktopAgent;
88
export async function closeMockAppWindow(testId: string) {
99
const appControlChannel = await fdc3.getOrCreateChannel(constants.ControlChannel);
1010
const contextPromise = waitForContext("windowClosed", testId, appControlChannel);
11-
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
1211
await broadcastCloseWindow(testId);
1312
await contextPromise;
1413
await wait(constants.WindowCloseWaitTime); // wait for window to close

src/test/v2.0/advanced/fdc3.raiseIntent-Result.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export default () =>
3232
const RaiseIntentVoidResult5secs = "(2.0-RaiseIntentVoidResult5secs) App A receives a void IntentResult after a 5 second delay";
3333
it(RaiseIntentVoidResult5secs, async () => {
3434
errorListener = await control.listenForError();
35-
const receiver = control.receiveContext(ControlContextType.aTestingIntentListenerTriggered, 8000);
35+
let receiver = control.receiveContext(ControlContextType.aTestingIntentListenerTriggered, 8000);
36+
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
3637
const intentResolution = await control.raiseIntent(Intent.aTestingIntent, ContextType.testContextX, undefined, 5000);
3738
control.validateIntentResolution(IntentApp.IntentAppA, intentResolution);
3839
let intentResultPromise = control.getIntentResult(intentResolution);
@@ -56,7 +57,8 @@ export default () =>
5657
const RaiseIntentContextResult5secs = "(2.0-RaiseIntentContextResult5secs) IntentResult resolves to testContextY instance after a 5 second delay";
5758
it(RaiseIntentContextResult5secs, async () => {
5859
errorListener = await control.listenForError();
59-
const receiver = control.receiveContext(ControlContextType.sharedTestingIntent1ListenerTriggered, 8000);
60+
let receiver = control.receiveContext(ControlContextType.sharedTestingIntent1ListenerTriggered, 8000);
61+
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
6062
const intentResolution = await control.raiseIntent(Intent.sharedTestingIntent1, ContextType.testContextY, undefined, 5000);
6163
control.validateIntentResolution(IntentApp.IntentAppB, intentResolution);
6264
const intentResultPromise = control.getIntentResult(intentResolution);
@@ -71,7 +73,8 @@ export default () =>
7173
const RaiseIntentChannelResult = "(2.0-RaiseIntentChannelResult) IntentResult resolves to a Channel object";
7274
it(RaiseIntentChannelResult, async () => {
7375
errorListener = await control.listenForError();
74-
const receiver = control.receiveContext(ControlContextType.sharedTestingIntent2ResultSent, constants.WaitTime);
76+
let receiver = control.receiveContext(ControlContextType.sharedTestingIntent2ResultSent, constants.WaitTime);
77+
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
7578
const intentResolution = await control.raiseIntent(Intent.sharedTestingIntent2, ContextType.testContextY, {
7679
appId: IntentApp.IntentAppE,
7780
});
@@ -89,6 +92,7 @@ export default () =>
8992
it(RaiseIntentPrivateChannelResult, async () => {
9093
errorListener = await control.listenForError();
9194
let receiver = control.receiveContext(ControlContextType.sharedTestingIntent2ResultSent, constants.WaitTime);
95+
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
9296
const intentResolution = await control.raiseIntent(Intent.sharedTestingIntent2, ContextType.testContextY, {
9397
appId: IntentApp.IntentAppF,
9498
});
@@ -105,7 +109,8 @@ export default () =>
105109
const RaiseIntentVoidResult61secs = "(2.0-RaiseIntentVoidResult61secs) App A receives a void IntentResult after a 61 second delay";
106110
it(RaiseIntentVoidResult61secs, async () => {
107111
errorListener = await control.listenForError();
108-
const receiver = control.receiveContext(ControlContextType.aTestingIntentListenerTriggered, 64000);
112+
let receiver = control.receiveContext(ControlContextType.aTestingIntentListenerTriggered, 64000);
113+
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
109114
const intentResolution = await control.raiseIntent(Intent.aTestingIntent, ContextType.testContextX, undefined, 61000);
110115
control.validateIntentResolution(IntentApp.IntentAppA, intentResolution);
111116
let intentResultPromise = control.getIntentResult(intentResolution);
@@ -120,7 +125,8 @@ export default () =>
120125
const RaiseIntentContextResult61secs = "(2.0-RaiseIntentContextResult61secs) IntentResult resolves to testContextY instance after a 61 second delay";
121126
it(RaiseIntentContextResult61secs, async () => {
122127
errorListener = await control.listenForError();
123-
const receiver = control.receiveContext(ControlContextType.sharedTestingIntent1ListenerTriggered, 64000);
128+
let receiver = control.receiveContext(ControlContextType.sharedTestingIntent1ListenerTriggered, 64000);
129+
await wait(300) // Added due to nested promise await race condition first observed by Jupnit.
124130
const intentResolution = await control.raiseIntent(Intent.sharedTestingIntent1, ContextType.testContextY, undefined, 61000);
125131
control.validateIntentResolution(IntentApp.IntentAppB, intentResolution);
126132
let intentResultPromise = control.getIntentResult(intentResolution);

src/test/v2.0/fdc3-2_0-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ export const waitForContext = async (contextType: string, testId: string, channe
5454
listenerPromise
5555
}
5656
})
57-
};
57+
};

0 commit comments

Comments
 (0)