-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: test re-loading manager with the same data #581
Conversation
This test-only change creates a project. Then, it makes a new manager with the same files and asserts that the project is still there. Because the only way to close a manager is to close the Node process, this test adds a bunch of scaffolding to do that.
` | ||
|
||
const result = temporaryFile({ extension: 'mjs' }) | ||
this.#t.teardown(() => fsPromises.rm(result, { maxRetries: 2 })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only nit, why is there two calls to t.teardown
(one here, and one in the constructor)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbFolder
and coreStorage
are created once per ManagerCustodian
. These JS files are created once per call to withManagerInSeparateProcess
.
In my test, for example, dbFolder
is created once (and therefore needs to be removed once) and the JS file is created twice (and therefore needs to be removed twice).
Does that answer your question?
This test-only change creates a project. Then, it makes a new manager with the same files and asserts that the project is still there.
Because the only way to close a manager is to close the Node process, this test adds a bunch of scaffolding to do that.