Skip to content

Commit

Permalink
Disambiguated the data folder of test-dwn.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
thehenrytsai committed Jan 2, 2024
1 parent a55711f commit 7b9bf23
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
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

0 comments on commit 7b9bf23

Please sign in to comment.