MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / reset

Method reset

packages/testlab/src/test-sandbox.ts:96–107  ·  view source on GitHub ↗

* Resets the TestSandbox. (Remove all files in it).

()

Source from the content-addressed store, hash-verified

94 * Resets the TestSandbox. (Remove all files in it).
95 */
96 async reset(): Promise<void> {
97 // Decache files from require's cache so future tests aren't affected incase
98 // a file is recreated in sandbox with the same file name but different
99 // contents after resetting the sandbox.
100 for (const key in require.cache) {
101 if (key.startsWith(this.path)) {
102 delete require.cache[key];
103 }
104 }
105
106 await emptyDir(this.path);
107 }
108
109 /**
110 * Deletes the TestSandbox.

Calls

no outgoing calls

Tested by

no test coverage detected