nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: adamgibbons/ics
Pull request #116 (2019-07-04 16:39:55)

add summary to schema
Fixes https://github.com/adamgibbons/ics/issues/103


Patch:
diff --git a/package.json b/package.json
index f53e782..f4b2a4c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "ics",
-  "version": "2.15.0",
+  "version": "2.15.1",
   "description": "iCal (ics) file generator",
   "main": "index.js",
   "scripts": {
diff --git a/src/schema/index.js b/src/schema/index.js
index 853860f..fbffd85 100644
--- a/src/schema/index.js
+++ b/src/schema/index.js
@@ -47,6 +47,7 @@ const alarmSchema = Joi.object().keys({
 })
 
 const schema = Joi.object().keys({
+  summary: Joi.string(),
   timestamp: Joi.any(),
   title: Joi.string(),
   productId: Joi.string(),


Test patch:
diff --git a/test/schema/index.spec.js b/test/schema/index.spec.js
index c6b4e56..72d0649 100644
--- a/test/schema/index.spec.js
+++ b/test/schema/index.spec.js
@@ -25,6 +25,24 @@ describe('.validateEvent', () => {
     })
   })
   describe('may have one and only one occurance of', () => {
+    it('summary', () => {
+      const { details } = validateEvent({
+        title: 'foo',
+        uid: 'foo',
+        start: [2018, 12, 1, 10, 30],
+        summary: 1
+      }).error
+
+      expect(details.some(p => p.message === '"summary" must be a string')).to.be.true
+
+      expect(validateEvent({
+        title: 'foo',
+        uid: 'foo',
+        start: [2018, 12, 1, 10, 30],
+        summary: 'be concise'
+      }).value.summary).to.exist
+    })
+
     it('description', () => {
       const { details } = validateEvent({
         title: 'foo',