Skip to content

Commit cc848aa

Browse files
committed
fix: New Mocha tests.
This removes unstubbing since it can't really work well, anyway, which fixes the Mocha tests that validate initialization and disposal for the KeyboardNavigation class.
1 parent 700b344 commit cc848aa

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/navigation_controller.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,5 @@ export class NavigationController {
303303
}
304304
this.removeShortcutHandlers();
305305
this.navigation.dispose();
306-
307-
FunctionStubber.getInstance().unstubPrototypes();
308306
}
309307
}

src/screenreader/function_stubber_registry.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@ class Registration<T> {
4444
return result;
4545
};
4646
}
47-
48-
unstubPrototype(): void {
49-
if (this.oldMethod) {
50-
throw new Error(
51-
`Function is not currently stubbed: ${this.methodNameToOverride}.`,
52-
);
53-
}
54-
const genericPrototype = this.classPrototype as any;
55-
genericPrototype[this.methodNameToOverride] = this.oldMethod;
56-
this.oldMethod = null;
57-
}
5847
}
5948

6049
export class FunctionStubber {
@@ -104,13 +93,6 @@ export class FunctionStubber {
10493
this.registrations.forEach((registration) => registration.stubPrototype());
10594
}
10695

107-
unstubPrototypes() {
108-
this.registrations.forEach((registration) =>
109-
registration.unstubPrototype(),
110-
);
111-
this.isFinalized = false;
112-
}
113-
11496
private static instance: FunctionStubber | null = null;
11597

11698
static getInstance(): FunctionStubber {

0 commit comments

Comments
 (0)