Skip to content

Commit d8aebc5

Browse files
src/test.ts
1 parent 8efa953 commit d8aebc5

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

tasks/vanilla/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solid-data-module-tasks",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Solid Data Module for tasks and issue tracking",
55
"type": "module",
66
"engines": {

tasks/vanilla/src/test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'dotenv/config';
2+
import { v7 } from 'css-authn';
3+
import { fetchTracker, Interpretation, addIssue, addComment } from './main.js';
4+
5+
const authenticatedFetch = await v7.getAuthenticatedFetch({
6+
email: process.env.SOLID_EMAIL,
7+
password: process.env.SOLID_PASSWORD,
8+
provider: process.env.SOLID_SERVER,
9+
});
10+
const trackerUrl = 'https://michielbdejong.solidcommunity.net/tasks/index.ttl#this';
11+
const localState: Interpretation = await fetchTracker(trackerUrl, authenticatedFetch);
12+
const issueUri = await addIssue(localState, {
13+
title: 'Use the Solid Data Module for Tasks',
14+
description: 'Solid app devs should not be rolling their own task tracker access code.',
15+
}, authenticatedFetch);
16+
const newComment = {
17+
issueUri,
18+
author: 'https://michielbdejong.solidcommunity.net/profile/card#me',
19+
text: `I totally agree at ${new Date().toUTCString()}`,
20+
};
21+
const commentUri = await addComment(localState, newComment, authenticatedFetch);
22+
console.log(commentUri);

0 commit comments

Comments
 (0)