diff --git a/README.md b/README.md index 01e2edb..eb0aab3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ globalThis.Testem?.afterTests(async (_config, _data, callback) => { }); ``` +![Checking for any leaking classes](https://github.com/mainmatter/memory-leak-detector/blob/main/assets/memory_leak_1.png) + This approach doesn't catch all memory-leaks as it will only detect the ones that have manipulated a window/document objects by e.g. storing references or not removed `addEventListener` calls. ### Asserting object count @@ -84,3 +86,5 @@ test("paginating back and forth", async function (assert) { assert.strictEqual(currentURL(), "users"); }); ``` + +![Checking for specific class in a test](https://github.com/mainmatter/memory-leak-detector/blob/main/assets/memory_leak_2.png) diff --git a/assets/memory_leak_1.png b/assets/memory_leak_1.png new file mode 100644 index 0000000..927631a Binary files /dev/null and b/assets/memory_leak_1.png differ diff --git a/assets/memory_leak_2.png b/assets/memory_leak_2.png new file mode 100644 index 0000000..0aa2af8 Binary files /dev/null and b/assets/memory_leak_2.png differ diff --git a/packages/memory-leak-detector/.gitignore b/packages/memory-leak-detector/.gitignore new file mode 100644 index 0000000..c2dd0c3 --- /dev/null +++ b/packages/memory-leak-detector/.gitignore @@ -0,0 +1 @@ +./README.md diff --git a/packages/memory-leak-detector/README.md b/packages/memory-leak-detector/README.md deleted file mode 120000 index fe84005..0000000 --- a/packages/memory-leak-detector/README.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file diff --git a/packages/memory-leak-detector/package.json b/packages/memory-leak-detector/package.json index cb0fa25..634ac91 100644 --- a/packages/memory-leak-detector/package.json +++ b/packages/memory-leak-detector/package.json @@ -5,6 +5,7 @@ "repository": "https://github.com/mainmatter/memory-leak-detector", "main": "index.js", "scripts": { + "prepublishOnly": "cp ../../README.md .", "start": "node server/index.js" }, "keywords": [],