@jrpool/kilotest 50.0.0 → 52.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +2 -2
- package/.github/workflows/periodic-smoke-tests.yml +2 -2
- package/.github/workflows/publish-mcp.yml +1 -1
- package/README.md +5 -5
- package/api/requestFeature.test.ts +81 -3
- package/api/requestFeature.ts +46 -10
- package/api/requestRetest.test.ts +7 -0
- package/api/requestTest.test.ts +23 -0
- package/api/requestTest.ts +7 -1
- package/api/util.test.ts +9 -0
- package/apiIntegration.test.ts +17 -0
- package/docs/SERVICE.md +27 -6
- package/env.example +8 -0
- package/index.test.ts +137 -0
- package/index.ts +52 -5
- package/linkValidation.test.ts +1 -0
- package/package.json +1 -1
- package/robots.txt +1 -0
- package/smokeTest.ts +10 -5
- package/test/setup.ts +5 -0
- package/util.test.ts +171 -13
- package/util.ts +127 -16
- package/web/deleteNotesForm/deleteNotesForm.test.ts +237 -0
- package/web/deleteNotesForm/index.html +29 -0
- package/web/deleteNotesForm/index.ts +167 -0
- package/web/manage/index.html +1 -0
- package/web/tutorialAI/index.ts +6 -11
- package/web/tutorialAI/tutorialAI.test.ts +9 -3
- package/web/tutorialWeb/tutorialWeb.test.ts +8 -2
- package/.claude/scheduled_tasks.lock +0 -1
|
@@ -14,6 +14,12 @@ import path from 'node:path';
|
|
|
14
14
|
|
|
15
15
|
const testDir = path.join(import.meta.dirname, '../../test/fixtures/comments');
|
|
16
16
|
process.env.TUTORIAL_AI_COMMENTS_PATH = path.join(testDir, 'tutorialAI.json');
|
|
17
|
+
// Blank the alert configuration unconditionally, before index.ts (whose handleComment
|
|
18
|
+
// calls sendAlert for a new comment) is ever imported below, so this file sends no real
|
|
19
|
+
// alert emails even when run directly rather than via `npm test`.
|
|
20
|
+
for (const key of ['MANAGER_EMAIL', 'ALERT_API_HOST', 'ALERT_API_PATH', 'ALERT_API_KEY', 'ALERT_FROM']) {
|
|
21
|
+
process.env[key] = '';
|
|
22
|
+
}
|
|
17
23
|
|
|
18
24
|
import {answer, handleComment} from './index.ts';
|
|
19
25
|
|
|
@@ -71,7 +77,7 @@ test('handleComment returns an error for a comment longer than 1000 characters',
|
|
|
71
77
|
assert.equal(result.message, 'Your comment was longer than 1000 characters');
|
|
72
78
|
});
|
|
73
79
|
|
|
74
|
-
test('handleComment returns an error for a comment
|
|
80
|
+
test('handleComment returns an error for a comment identical to one already submitted', {timeout: 500}, async () => {
|
|
75
81
|
await fs.writeFile(getCommentsPath(), '[]\n');
|
|
76
82
|
const content = 'This is a duplicate comment.';
|
|
77
83
|
const firstResult = await handleComment(content);
|
|
@@ -80,7 +86,7 @@ test('handleComment returns an error for a comment repeating one submitted withi
|
|
|
80
86
|
assert.equal(secondResult.status, 'error');
|
|
81
87
|
assert.equal(
|
|
82
88
|
secondResult.message,
|
|
83
|
-
'Your comment
|
|
89
|
+
'Your comment is identical to one already submitted, but you are welcome to submit a different comment'
|
|
84
90
|
);
|
|
85
91
|
});
|
|
86
92
|
|
|
@@ -91,7 +97,7 @@ test('handleComment saves a sanitized comment and returns ok', {timeout: 500}, a
|
|
|
91
97
|
const comments = JSON.parse(await fs.readFile(getCommentsPath(), 'utf8'));
|
|
92
98
|
assert.equal(comments.length, 1);
|
|
93
99
|
assert.equal(comments[0].content, 'This is a test comment.');
|
|
94
|
-
assert.ok(comments[0].
|
|
100
|
+
assert.ok(comments[0].timeStamp);
|
|
95
101
|
});
|
|
96
102
|
|
|
97
103
|
test('handleComment strips HTML tags and control characters', {timeout: 500}, async () => {
|
|
@@ -14,6 +14,12 @@ import path from 'node:path';
|
|
|
14
14
|
|
|
15
15
|
const testDir = path.join(import.meta.dirname, '../../test/fixtures/comments');
|
|
16
16
|
process.env.TUTORIAL_WEB_COMMENTS_PATH = path.join(testDir, 'tutorialWeb.json');
|
|
17
|
+
// Blank the alert configuration unconditionally, before index.ts (whose handleComment
|
|
18
|
+
// calls sendAlert for a new comment) is ever imported below, so this file sends no real
|
|
19
|
+
// alert emails even when run directly rather than via `npm test`.
|
|
20
|
+
for (const key of ['MANAGER_EMAIL', 'ALERT_API_HOST', 'ALERT_API_PATH', 'ALERT_API_KEY', 'ALERT_FROM']) {
|
|
21
|
+
process.env[key] = '';
|
|
22
|
+
}
|
|
17
23
|
|
|
18
24
|
import {answer, handleComment} from './index.ts';
|
|
19
25
|
|
|
@@ -73,7 +79,7 @@ test('handleComment returns an error for a comment longer than 1000 characters',
|
|
|
73
79
|
assert.equal(result.message, 'Your comment was longer than 1000 characters');
|
|
74
80
|
});
|
|
75
81
|
|
|
76
|
-
test('handleComment returns an error for a comment
|
|
82
|
+
test('handleComment returns an error for a comment identical to one already submitted', {timeout: 500}, async () => {
|
|
77
83
|
await fs.writeFile(getCommentsPath(), '[]\n');
|
|
78
84
|
const content = 'This is a duplicate comment.';
|
|
79
85
|
const firstResult = await handleComment(content);
|
|
@@ -82,7 +88,7 @@ test('handleComment returns an error for a comment repeating one submitted withi
|
|
|
82
88
|
assert.equal(secondResult.status, 'error');
|
|
83
89
|
assert.equal(
|
|
84
90
|
secondResult.message,
|
|
85
|
-
'Your comment
|
|
91
|
+
'Your comment is identical to one already submitted, but you are welcome to submit a different comment'
|
|
86
92
|
);
|
|
87
93
|
});
|
|
88
94
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"sessionId":"f44e6b44-375e-4007-879a-19e4e5ed34a0","pid":90042,"procStart":"Sun Sep 20 03:19:03 2026","acquiredAt":1789874948676}
|