mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 12:57:11 -06: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:
parent
cdf12f91c7
commit
b8ec791ca1
@ -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", () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user