Skip to content
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

Disambiguated the data folder of test-dwn.ts #96

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"extension": [".js"],
"include": ["dist/esm/src/**"],
"exclude": ["dist/esm/src/types/**"],
"reporter": ["text", "cobertura"]
"reporter": ["text", "cobertura", "html"]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
.DS_STORE
browser-test
dist

# location of levelDB data storage for DWN
data

# location of levelDB data storage for DWN created by tests
data-test

etc
node_modules
tmp
Expand Down
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"runtimeVersion": "18",
"type": "node",
"request": "launch",
"name": "Tests - Node",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha",
"runtimeArgs": ["dist/esm/tests/**/*.spec.js"],
"console": "internalConsole"
}
]
}
14 changes: 10 additions & 4 deletions tests/test-dwn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ import {
MessageStoreLevel,
} from '@tbd54566975/dwn-sdk-js';

const dataStore = new DataStoreLevel({ blockstoreLocation: 'data/DATASTORE' });
const eventLog = new EventLogLevel({ location: 'data/EVENTLOG' });
const testDwnDataDirectory = 'data-test';

const dataStore = new DataStoreLevel({
blockstoreLocation: `${testDwnDataDirectory}/DATASTORE`,
});
const eventLog = new EventLogLevel({
location: `${testDwnDataDirectory}/EVENTLOG`,
});
const messageStore = new MessageStoreLevel({
blockstoreLocation: 'data/MESSAGESTORE',
indexLocation: 'data/INDEX',
blockstoreLocation: `${testDwnDataDirectory}/MESSAGESTORE`,
indexLocation: `${testDwnDataDirectory}/INDEX`,
});

export const dwn = await Dwn.create({ eventLog, dataStore, messageStore });
Expand Down