event 187 solution
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
diff --git a/tests/acceptance/2/CRITERIA.json b/tests/acceptance/2/CRITERIA.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..18e786f29f08cac51c0988555e4f8ae963c43373
|
||||
--- /dev/null
|
||||
+++ b/tests/acceptance/2/CRITERIA.json
|
||||
@@ -0,0 +1,24 @@
|
||||
+{
|
||||
+ "schema": "elffuss-t2t/criteria@2",
|
||||
+ "issue": 2,
|
||||
+ "criteria": [
|
||||
+ {
|
||||
+ "index": 1,
|
||||
+ "tests": [
|
||||
+ "tests/acceptance/2/criteria.test.js::criterion 1"
|
||||
+ ]
|
||||
+ },
|
||||
+ {
|
||||
+ "index": 2,
|
||||
+ "tests": [
|
||||
+ "tests/acceptance/2/criteria.test.js::criterion 2"
|
||||
+ ]
|
||||
+ },
|
||||
+ {
|
||||
+ "index": 3,
|
||||
+ "tests": [
|
||||
+ "tests/acceptance/2/criteria.test.js::criterion 3"
|
||||
+ ]
|
||||
+ }
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/tests/acceptance/2/criteria.test.js b/tests/acceptance/2/criteria.test.js
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5794ff47df37b11d316123ee0b0db4ea7037d4c8
|
||||
--- /dev/null
|
||||
+++ b/tests/acceptance/2/criteria.test.js
|
||||
@@ -0,0 +1,20 @@
|
||||
+import { test } from 'node:test'
|
||||
+import assert from 'node:assert/strict'
|
||||
+import { readFileSync } from 'node:fs'
|
||||
+import * as mod from '../../../web/js/skills.js' // the code under test: call it as mod.<name>(...)
|
||||
+const source = readFileSync(new URL('../../../web/js/skills.js', import.meta.url), 'utf8') // the text of web/js/skills.js, for a criterion about how the file is written
|
||||
+
|
||||
+test('criterion 1', () => {
|
||||
+ // `parseSkill("---\r\nname: demo\r\ndescription: x\r\n---\r\nBody")` returns `{ name: "demo", description: "x", content: "Body" }`.
|
||||
+ assert.deepEqual(mod.parseSkill("---\r\nname: demo\r\ndescription: x\r\n---\r\nBody"), { name: "demo", description: "x", content: "Body" })
|
||||
+})
|
||||
+
|
||||
+test('criterion 2', () => {
|
||||
+ // `parseSkill("---\nname: demo\ndescription: x\n---\nBody")` returns `{ name: "demo", description: "x", content: "Body" }`.
|
||||
+ assert.deepEqual(mod.parseSkill("---\nname: demo\ndescription: x\n---\nBody"), { name: "demo", description: "x", content: "Body" })
|
||||
+})
|
||||
+
|
||||
+test('criterion 3', () => {
|
||||
+ // `parseSkill("Body only", "fallback")` returns `{ name: "fallback", description: "", content: "Body only" }`.
|
||||
+ assert.deepEqual(mod.parseSkill("Body only", "fallback"), { name: "fallback", description: "", content: "Body only" })
|
||||
+})
|
||||
1
events/0000000187.json
Normal file
1
events/0000000187.json
Normal file
@@ -0,0 +1 @@
|
||||
{"data":{"cites":[],"envelope":{"delegation":{"identity":"0x16808507970f18ea89a07ad1d30b53e7e3a3891d","nonce":"1790923316","project":"0x0000000000000000000000000000000000000000000000000000000000000000","scopes":3,"sessionX":"0xcb850292d34644fc2c21598b934b94b5fcb0e6f2359c727df7666df8700d940c","sessionY":"0x7a30e145e0151461b43fcdd2b4789b81b5efe08af3688be6b8d3efb666860734","validFrom":"1790923316","validUntil":"1791528116"},"delegationSignature":"0x169fdc790559880429426a2d1a3c7fc0c46a15950a5e4ca2d1d0b90815225e1e486644e860f3dc98c672ace2f20aee152cd41e467020580ab096b1721cbd70e41b","kind":"session","signature":"0x3b6281c8455067eadde9e1fd6b66ea04e968b23a48eac56969fc17894b95fb2a27e80e1268996c1b1a18c67fab063d34989b4471e511ac245f1e99415f272bf1"},"mainHead":null,"message":{"author":"0x16808507970f18ea89a07ad1d30b53e7e3a3891d","baseCommit":"0xf6006681f10c58a12e555414cf0bac8fda7293c2","basePartial":"0x0000000000000000000000000000000000000000000000000000000000000000","citesHash":"0x0000000000000000000000000000000000000000000000000000000000000000","issueId":"0xb808c26a4cf912dcceaaa1cdf81dd5430e77b8592836e44b85927e62752428d0","issuedAt":"1790923402","lines":0,"nonce":"1790923402000","patchHash":"0xf90be676efd887facf00a101500f387214d60c07efa268ae758bb4596b6c0be8","project":"0x16d6e75341c5f21003a4d9e89b416a545f7335094d7df139fd20942c9b7fb2de","repo":"0x898cee99797af3d9873c48ae110651ee9fcde15cbf07fe9c5359e4a649ac2ae3"},"pr":"elffuss/claw:item/0xf54069ff336d8ad5b45c25e108e462821befc0a9d40b83949a7e7f333f0390f2"},"eventHash":"0x1bf6007db9e70b9af4eeee40766eda6152c2e624dbd1b56b0fb24b0e740cbdc7","gatewaySignature":"0xa0fdbf80bb41154f65e4266da31ed83c4b787147aeccde306b55e7520f34e67c356d43904ca1a81f1bc72b26af17ceb53a7dd3da24053e97f1a4cd6c4d493ac81c","prev":"0x45020f755993e2627f012d144337ffbc9f184326fa6ed95e51a523f4c220a855","seq":187,"ts":1790923402,"type":"solution","v":2}
|
||||
Reference in New Issue
Block a user