From fbc0fd8f4a2dee16dae88a49b27e33d1484fc078 Mon Sep 17 00:00:00 2001 From: Henry Tsai Date: Tue, 2 Jan 2024 15:00:37 -0800 Subject: [PATCH] Disambiguated the data folder of test-dwn.ts --- .c8rc.json | 2 +- .gitignore | 6 ++++++ .vscode/launch.json | 17 +++++++++++++++++ tests/test-dwn.ts | 14 ++++++++++---- 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.c8rc.json b/.c8rc.json index 18be71c..4304477 100644 --- a/.c8rc.json +++ b/.c8rc.json @@ -4,5 +4,5 @@ "extension": [".js"], "include": ["dist/esm/src/**"], "exclude": ["dist/esm/src/types/**"], - "reporter": ["text", "cobertura"] + "reporter": ["text", "cobertura", "html"] } diff --git a/.gitignore b/.gitignore index 0197bc8..edf6ce6 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6ff6553 --- /dev/null +++ b/.vscode/launch.json @@ -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" + } + ] +} diff --git a/tests/test-dwn.ts b/tests/test-dwn.ts index 515ece5..19ffd41 100644 --- a/tests/test-dwn.ts +++ b/tests/test-dwn.ts @@ -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 });