vscode/test
Connor Peet a0b548807a
eng: add assertHeap method for memory assertions (#198334)
This adds an `assertHeap` function that can be used in tests. It
takes a heap snapshot, and asserts the state of classes in memory. This
works in Node and the Electron sandbox, but is a no-op in the browser.
Snapshots are process asynchronously and will report failures at the end
of the suite.

This method should be used sparingly (e.g. once at the end of a suite to
ensure nothing leaked before), as gathering a heap snapshot is fairly
slow, at least until V8 11.5.130 (https://v8.dev/blog/speeding-up-v8-heap-snapshots).

When used, the function will ensure the test has a minimum timeout
duration of 20s to avoid immediate failures.

It takes options containing a mapping of class names, and assertion functions
to run on the number of retained instances of that class. For example:

```ts
assertSnapshot({
	classes: {
		ShouldNeverLeak: count => assert.strictEqual(count, 0),
		SomeSingleton: count => assert(count <= 1),
	}
});
```

Closes https://github.com/microsoft/vscode/issues/191920
2023-11-15 10:41:22 -08:00
..
automation Use a polling approach for writing and asserting 2023-11-08 09:20:44 -08:00
integration Cleanup dependencies (#195026) 2023-10-09 09:34:15 +02:00
leaks Bump dependencies for debug sub-dependency (#195513) 2023-10-13 09:01:12 -07:00
monaco Fixes "_b is not defined" error 2023-11-15 16:53:00 +01:00
smoke Correct setting name in smoke test 2023-11-11 05:15:09 -08:00
unit eng: add assertHeap method for memory assertions (#198334) 2023-11-15 10:41:22 -08:00
.mocharc.json eng: update mocha 2 -> 8 2020-12-17 11:24:15 -08:00
cgmanifest.json
README.md Fix supported markdown-lint violations in markdown files (#190750) 2023-08-24 08:37:25 +00:00

VSCode Tests

Contents

This folder contains the various test runners for VSCode. Please refer to the documentation within for how to run them:

  • unit: our suite of unit tests (README)
  • integration: our suite of API tests (README)
  • smoke: our suite of automated UI tests (README)