-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mount improvements and unmount
- Loading branch information
Showing
6 changed files
with
63 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import { createStorage, snapshot } from '../src' | ||
import memory from '../src/drivers/memory' | ||
|
||
const data = { | ||
'etc:conf': 'test', | ||
'data:foo': 'bar' | ||
} | ||
|
||
describe('snapshot', () => { | ||
it('snapshot', async () => { | ||
describe('storage', () => { | ||
it('mount/unmount', async () => { | ||
const storage = createStorage() | ||
await storage.setItems('', data) | ||
expect(await snapshot(storage, '')).toMatchObject(data) | ||
await storage.mount('/mnt', memory(), data) | ||
expect(await snapshot(storage, '/mnt')).toMatchObject(data) | ||
}) | ||
|
||
it('snapshot (subpath)', async () => { | ||
it('snapshot', async () => { | ||
const storage = createStorage() | ||
await storage.setItems('', data) | ||
expect(await snapshot(storage, 'etc')).toMatchObject({ conf: 'test' }) | ||
expect(await snapshot(storage, '')).toMatchObject(data) | ||
}) | ||
}) |