mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Don't call afterEach within beforeEach (#46963)
Otherwise, a new afterEach handler is added for each test case and the number of handlers run grows quadratically.
This commit is contained in:
@@ -130,9 +130,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
MapShim = ShimCollections.createMapShim(getIterator);
|
||||
afterEach(() => {
|
||||
MapShim = undefined!;
|
||||
});
|
||||
});
|
||||
afterEach(() => {
|
||||
MapShim = undefined!;
|
||||
});
|
||||
|
||||
it("iterates values in insertion order and handles changes with string keys", () => {
|
||||
|
||||
@@ -128,9 +128,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
SetShim = ShimCollections.createSetShim(getIterator);
|
||||
afterEach(() => {
|
||||
SetShim = undefined!;
|
||||
});
|
||||
});
|
||||
afterEach(() => {
|
||||
SetShim = undefined!;
|
||||
});
|
||||
|
||||
it("iterates values in insertion order and handles changes with string keys", () => {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
namespace ts {
|
||||
describe("unittests:: debugDeprecation", () => {
|
||||
let loggingHost: LoggingHost | undefined;
|
||||
beforeEach(() => {
|
||||
const loggingHost = Debug.loggingHost;
|
||||
afterEach(() => {
|
||||
Debug.loggingHost = loggingHost;
|
||||
});
|
||||
loggingHost = Debug.loggingHost;
|
||||
});
|
||||
afterEach(() => {
|
||||
Debug.loggingHost = loggingHost;
|
||||
loggingHost = undefined;
|
||||
});
|
||||
describe("deprecateFunction", () => {
|
||||
it("silent deprecation", () => {
|
||||
|
||||
Reference in New Issue
Block a user