Default to not creating files and clean up flies created during unit tests.
Closed this issue · 1 comments
DevinCrumb commented
Describe the feature request
The Unleash Client is creating unwanted and prosibly problimatic files. The application may not have permission to write to the directory used by the client or there may be other reasons where creating a file is problematic. Default should be to not use the file system.
Also, when running the Unit Test, it creates files that it does not clean up. The Unit test needs to make sure any files it creates, it deletes when the test ends, even when the test fails.
Background
No response
Solution suggestions
No response
ivarconr commented
Hi,
you can customize this behaviour yourself via a custom store provider and the Node SDK comes with the InMemStorageProvider:
import { initialize, InMemStorageProvider } from 'unleash-client';
const client = initialize({
appName: 'my-application',
url: 'http://localhost:3000/api/',
customHeaders: { Authorization: '<YOUR_API_TOKEN>' },
storageProvider: new InMemStorageProvider(),
});