{"_id":"@jamietanna/spectral-test-harness","_rev":"5-a257310d53aa507e93c2674002788dea","name":"@jamietanna/spectral-test-harness","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@jamietanna/spectral-test-harness","version":"0.1.0","description":"A test harness for validation of Spectral API linting rules","main":"index.js","dependencies":{"@stoplight/spectral-core":"^1.8.0","@stoplight/spectral-parsers":"^1.0.1","@stoplight/spectral-runtime":"^1.0.0","@stoplight/types":"^12.3.0"},"devDependencies":{"standard":"^16.0.4"},"scripts":{"lint":"standard","lint:fix":"standard --fix"},"repository":{"type":"git","url":"git+https://gitlab.com/jamietanna/spectral-test-harness.git"},"keywords":["spectral","test","linting"],"author":{"name":"Jamie Tanna"},"license":"Apache-2.0","bugs":{"url":"https://gitlab.com/jamietanna/spectral-test-harness/issues"},"homepage":"https://gitlab.com/jamietanna/spectral-test-harness#readme","gitHead":"681d6d1da67053cadbf037d316fcb16c258480eb","_id":"@jamietanna/spectral-test-harness@0.1.0","_nodeVersion":"17.3.0","_npmVersion":"8.3.0","dist":{"integrity":"sha512-DsTaQ1xD/ZD0Gn1HXIm6YaOgRte/IBqIc3GfATaiKUjN8gcCfuExrKgQdDekBl8/uL7TTPCQXzpULdFbxjumeQ==","shasum":"981f4001032d53f038b09cfb6870d6a47b5b3689","tarball":"https://registry.npmjs.org/@jamietanna/spectral-test-harness/-/spectral-test-harness-0.1.0.tgz","fileCount":2,"unpackedSize":2657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxDtxCRA9TVsSAnZWagAADzsP/A6BRIcm8gGY6E7P3PXD\nJNk9X6BCO0oejso6oGfcdNwiyUEqVU2nw0goul0ZfYZZ5QIIqLZeZviTdjRe\nCmAp9jGaZHlNr4FRs9v8RMzWzmhpk9WZzuwSvooBNwMxL7Iq1lt2kBXhNloa\nGnd/uDsD0m26N5Ezwac9jiMNNhvjp5v9EWSW74am5en+ILruf2kfx7v0YJiB\nf06cN6dKfT5RASmVkwUbBgGhJrHr/P5vDlLe2/zAaUdiLrHbM7tsGk8EMI7N\nN02fWCFj/zaqzdN3jQHDJpkkeYc+pOQLgL9HmN2DRQXYsl3BZx0YmIzeLmRa\nyHJVuBciklpMxQ43C72qTlfbU+OG66qe/kcmd1Hs599+/BjassRqdq/4zPO9\nbH3JPsM6t5GcwkfRQcCxd5Y61XwFkJbT+31XbGCq6mV6Osp+v9vTItcIRR4J\n4h74C+AHKdqvLo2M1PLf4cd//N0lhzs5Momr61JHzjcwSz+Y+Pgajf5/L49n\n3bEbbMCwisOCRca1zSakC7oKYfWrHj6+MwG7mRVJ4hLc6n4Fo+5np0xCYKK7\novr7xpRoffIMOrFnLrqF5R1+EvtyjEFAQot6obX15mXwZR0MlBi+eS2d2P70\nESCM34tUBSJ7bZAiS7gUHbWyOgo/S7pXLwYYnkKGKF5+LV+ScpSgu6dGJylZ\nJ9Ry\r\n=2b7f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCh5EWqnO9A5s4cQiITXDYb60wSadw12bhSvtnLN+imgAIgPelr5XwlnO2iDT+cbUI4C98w/InqVgdMpSLStDQWQS0="}]},"_npmUser":{"name":"jamietanna","email":"jamie@jamietanna.co.uk"},"directories":{},"maintainers":[{"name":"jamietanna","email":"jamie@jamietanna.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spectral-test-harness_0.1.0_1640250225804_0.43911421087371916"},"_hasShrinkwrap":false},"0.1.1":{"name":"@jamietanna/spectral-test-harness","version":"0.1.1","description":"A test harness for validation of Spectral API linting rules","main":"index.js","dependencies":{"@stoplight/spectral-core":"^1.8.0","@stoplight/spectral-parsers":"^1.0.1","@stoplight/spectral-ruleset-bundler":"^1.1.0","@stoplight/spectral-runtime":"^1.0.0","@stoplight/types":"^12.3.0"},"devDependencies":{"ci-publish":"^1.3.1","standard":"^16.0.4"},"scripts":{"lint":"standard","lint:fix":"standard --fix"},"repository":{"type":"git","url":"git+https://gitlab.com/jamietanna/spectral-test-harness.git"},"keywords":["spectral","test","linting"],"author":{"name":"Jamie Tanna"},"license":"Apache-2.0","bugs":{"url":"https://gitlab.com/jamietanna/spectral-test-harness/issues"},"homepage":"https://gitlab.com/jamietanna/spectral-test-harness#readme","gitHead":"1098f5f8cbf871e8416a6e0b731855c0b673adee","_id":"@jamietanna/spectral-test-harness@0.1.1","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-eOIwOdGpvof6u3hMVbFsCuOMp0TtJOazdWJpUjYWIJcmJqz+U+qaSnQBtkUiI046MQ1jEYrufypcogav+6tAIA==","shasum":"6e608d087cb8015936d3a7f75f314063b61d477e","tarball":"https://registry.npmjs.org/@jamietanna/spectral-test-harness/-/spectral-test-harness-0.1.1.tgz","fileCount":5,"unpackedSize":6778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxEvwCRA9TVsSAnZWagAAjJwP/2SyH7CRPp3KVKCaPMf6\nTDkN76LX26Ud2UgN8g3NddNCDeLpeIAw11J4HrME8MoubAqQMZ2GSzNAwnIU\nOOV6DR/UcHy532+OuepicWf43lilWurRJCoTOkk/6fShdpFSdnCbcwp1Bvm6\n8YG9QztFUs+jmqCDsS6WgJgQQ31pNj9qyA+/9tJu3tCFK5S2UQi8bjc33Q+g\nqoqwoqw42Cp1lAXmhQLYQWcRsRTyLyFkodRaF1upW5FlhlKM4JJryjMeEWVB\nL6JLDWJ01aiCsoYkpbk3GJ39YaIJ7b5qc/Zcjy/6qHaHtqEio2PuuX+UIFXz\nTJeT6KWIIMrCTX1Mv2xqiIuste8QP4t5ebXp0PhlLyLZ0Y3U5gAaiSiAYtr4\noZK0BwdhYqjQwWzSeTjnjgNorIEUaKjC8fbAyIYlp90WQtrTKtF9nWtU6W6k\nhr47blR0t0G8Rea3PLiO6ZVkDqVuHOfXZzA7R3ed3NDQViRR+44bTyohRdLx\n2e2YvmLjNsAPt9as+CVtBbzeEeM+OcocJ1RAfSL/zFzklS9Fi1l6IYHps+GU\n0+sp14azc194VIF26W9lAeP0zcAwxV3yiluYfTPSc5Q21+HNAcFGiYdLncXU\nqeBn9EI9mAUHtC5oCZif8FXjel1u9aFaoWp65LPqirsW43N37qNWmX00imS6\nT4Wb\r\n=vW83\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTJ4jaK7TfJ5xHUXyamV4XmlvxYkISqrfAOE7X90JekgIhAPX2bCOddxocwBvy+a7lEA1oHq/iQCeRWtqVMfud2QPe"}]},"_npmUser":{"name":"jamietanna","email":"jamie@jamietanna.co.uk"},"directories":{},"maintainers":[{"name":"jamietanna","email":"jamie@jamietanna.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spectral-test-harness_0.1.1_1640254448028_0.8883816590352802"},"_hasShrinkwrap":false},"0.1.2-0":{"name":"@jamietanna/spectral-test-harness","version":"0.1.2-0","description":"A test harness for validation of Spectral API linting rules","main":"index.js","dependencies":{"@stoplight/spectral-core":"^1.8.0","@stoplight/spectral-parsers":"^1.0.1","@stoplight/spectral-ruleset-bundler":"^1.1.0","@stoplight/spectral-runtime":"^1.0.0","@stoplight/types":"^12.3.0"},"devDependencies":{"ci-publish":"^1.3.1","standard":"^16.0.4"},"scripts":{"lint":"standard","lint:fix":"standard --fix","ci-publish":"ci-publish"},"repository":{"type":"git","url":"git+https://gitlab.com/jamietanna/spectral-test-harness.git"},"keywords":["spectral","test","linting"],"author":{"name":"Jamie Tanna"},"license":"Apache-2.0","bugs":{"url":"https://gitlab.com/jamietanna/spectral-test-harness/issues"},"homepage":"https://gitlab.com/jamietanna/spectral-test-harness#readme","gitHead":"9fc25fd0afdaff5a68f3487258d97839f15d9da3","_id":"@jamietanna/spectral-test-harness@0.1.2-0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-gfCJhvawgN8rY9u93yqPvj+bfouVITka3sCoUmV0MWPDYMs1JlaK9Lyfs0A3/HmlGoj3NVdE7tIAniF+Vq3HbQ==","shasum":"6437e71ba688951c5f717d1388a675b8c2f223c4","tarball":"https://registry.npmjs.org/@jamietanna/spectral-test-harness/-/spectral-test-harness-0.1.2-0.tgz","fileCount":5,"unpackedSize":6675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxE8dCRA9TVsSAnZWagAAnRcP/i+2G5aXDUWB6PqaLZhS\nyqV/8apfZMRiK9OaJc4mPkGiSdwjyPC9L0V9qxGgyrIYlInol1aRsug77Bot\nP6r7e1tFP3UpsfpAKiAkSAZNQEJiTBgTezIHmSu3RluzNzkur1J8coVb/KUV\nOO1W8Bi8yEcjcbdHZADYpnkMqvBh+tgZhecttItyBIPOrGAiV+29yOYaKr1K\ntNIfluLojzFM8eDykejLd867PV9ogk3wxXFrV+4FCBB4fsKirzwxgPNkEYdO\n+vnL4LPa3A0Bt34hD2qCOTYfi5ay0ByH0bm+wxNng+xeJnu9/pq65ChfM4fw\nnbOTxJBZfGSsZc2FO80jZ2zwX6fN99Ijh58oHl3KDgIoRebI8rhPO8YXgBAK\nV1+gN8lOch/0PcnUJ/u1y4zFkklfe1BeseDzUv8LS+Q0Tby1HLTj3sjQzajC\nazf66Efew4q3sEmyqX80XzX18+aFL1hq5GPxs073+pibZL9x0b26g/t9SfQR\nev2dpKNuK6o5nbcQwlfTt7hKDuOThqqa+XLrvuKyTNQH29SIrs+qGWQ0aNTv\nT+boFGqacBTFEi0wBOVuT5rtWXPelB4Iyysw7lXlEQHFYLw5NmgiofO1q9Xt\n/azMlOdmaK+chKUUNubOA7YJ8+3kSi1sNnjA+492p+xEZX4kkvBGpbDMgKF9\n4z2H\r\n=Q81k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF0OTad9nSbjS7VkykHPlXfPBn8Hj5BYup1jaoQX0EpSAiEA1WdiEOiZ8CqJB1QvFzXlRB/HPq2Kd8mW01eO5YBmqto="}]},"_npmUser":{"name":"jamietanna","email":"jamie@jamietanna.co.uk"},"directories":{},"maintainers":[{"name":"jamietanna","email":"jamie@jamietanna.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spectral-test-harness_0.1.2-0_1640255261428_0.21884048825203029"},"_hasShrinkwrap":false},"0.2.0":{"name":"@jamietanna/spectral-test-harness","version":"0.2.0","description":"A test harness for validation of Spectral API linting rules","main":"index.js","dependencies":{"@stoplight/spectral-core":"^1.8.0","@stoplight/spectral-parsers":"^1.0.1","@stoplight/spectral-ruleset-bundler":"^1.1.0","@stoplight/spectral-runtime":"^1.0.0","@stoplight/types":"^12.3.0"},"devDependencies":{"ci-publish":"^1.3.1","standard":"^16.0.4"},"scripts":{"lint":"standard","lint:fix":"standard --fix","ci-publish":"ci-publish"},"repository":{"type":"git","url":"git+https://gitlab.com/jamietanna/spectral-test-harness.git"},"keywords":["spectral","test","linting"],"author":{"name":"Jamie Tanna"},"license":"Apache-2.0","bugs":{"url":"https://gitlab.com/jamietanna/spectral-test-harness/issues"},"homepage":"https://gitlab.com/jamietanna/spectral-test-harness#readme","gitHead":"69793ef0f7d77188563f6e4677d8cd3c7d639724","_id":"@jamietanna/spectral-test-harness@0.2.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-v/YyYQmFbLKGMZXAUl+9Ejps9WY7nXR0WgSwMx9XaAhgKEyBPCju+NdJpI+GaflTMIULwSOyW2iXynUwNn5KJg==","shasum":"b8fee97540e8e1a5b1246151570f4a00810a5418","tarball":"https://registry.npmjs.org/@jamietanna/spectral-test-harness/-/spectral-test-harness-0.2.0.tgz","fileCount":5,"unpackedSize":6896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1HDKCRA9TVsSAnZWagAAKPAQAIlZZHNes89jwREo2ZY1\n7yb7uN1kxz0vpxQc179Z9YzWvpUjEBdr/f0vpyfqfTVRjTpwnDHl8oUCI0K4\nYqEoZ9BA7vRm4wmLQE+1yZazqThavHOy6KleNU9/a97Dqy1SGMaRHXfbDCkh\n5QAO/ud03MDCzDAA3XWPnmYd4xOjk8YMAtU1LxMH8e8hZoY1j9TWoriMbnP9\nq+qO1q0fdife2zw36BzPre82H9Bfgtfv+2lWGKLiaelzonc3oTF97T3RCx0r\n++4qKuATR0hIGgbNKYtctyl+iWYgIPxXdSCcHdjjxpa042ylMKgws39V6hOh\nOLvEXWsr3M7o/YuuzCZtL0OtRCkJy9zS787rw+QgzxPgh0WOAbN03ufxmyFZ\nK3U2XMPG0vHJtM6Nm5JbNdIhzM/i2kZ8qjZy7DeTB+5js7mzT1YQsedRg5pn\n28PWZE26dKtJ8DPg55w5bwBMoG7MTkRtfmcgsbs3PvbnxLxeo0FAPjAjWoSX\no7Fz3G3KRCEhnjrxKDyHgTojbnT7b5uC7pmkfYS67ymmBwzocNXSkaBVp79V\nvI+44QDhUkbZSt8MmuMsqzUgYe1LOoY8s/Mg510RKU1uT06NdkOlqL87u7hb\neBCfcTJ5bVuuLbXcahtUO/uRh5AGTCuEQAMNMbyRi/GEekjFjLAXR9JaGO4F\n1FTF\r\n=cAn2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHCLS+jNF4KX4NjtitnhfmeDBJztQp5QYcqewHjgvtUzAiAKtoadTEDgcAmndmZ5aEHtCu6MWt52geMHk4FbCf9g8w=="}]},"_npmUser":{"name":"jamietanna","email":"jamie@jamietanna.co.uk"},"directories":{},"maintainers":[{"name":"jamietanna","email":"jamie@jamietanna.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spectral-test-harness_0.2.0_1641312458781_0.8225102688027153"},"_hasShrinkwrap":false},"0.3.0":{"name":"@jamietanna/spectral-test-harness","version":"0.3.0","description":"A test harness for validation of Spectral API linting rules","main":"index.js","dependencies":{"@stoplight/spectral-core":"^1.8.0","@stoplight/spectral-parsers":"^1.0.1","@stoplight/spectral-ruleset-bundler":"^1.1.0","@stoplight/spectral-runtime":"^1.0.0","@stoplight/types":"^12.3.0"},"devDependencies":{"ci-publish":"1.3.1","standard":"16.0.4"},"scripts":{"lint":"standard","lint:fix":"standard --fix","ci-publish":"ci-publish"},"repository":{"type":"git","url":"git+https://gitlab.com/jamietanna/spectral-test-harness.git"},"keywords":["spectral","test","linting"],"author":{"name":"Jamie Tanna"},"license":"Apache-2.0","bugs":{"url":"https://gitlab.com/jamietanna/spectral-test-harness/issues"},"homepage":"https://gitlab.com/jamietanna/spectral-test-harness#readme","gitHead":"02d2f329a8280a9ea97f04453a1b68ee8138252f","_id":"@jamietanna/spectral-test-harness@0.3.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-kAQmMVhR++o7VLA95dGlSKUwvA9nE0htASO0onAxCZwsFqf3rpUK1C4NPPoic9XKZ2iAYLlzbScdNQthIK7QbA==","shasum":"e7ee6a262d2702fc272ac58a5df8000632f14e7c","tarball":"https://registry.npmjs.org/@jamietanna/spectral-test-harness/-/spectral-test-harness-0.3.0.tgz","fileCount":6,"unpackedSize":6852,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtFPbHBwQrP86C7oMbyAt2jscINNvlTPoZrqlHQlYyVwIgcE1Lyi1qjwyV+o32wGayyFLQUUKw2k4khl6ZGl9HZ3U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkG2AuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYgg//XeX/Pue1z9GCmBmNlT/RyiMfpmLKn/jC+02bvakxx+Rmn92q\r\nHvyiAddJPvP+bYIFjQsfXYNjNwVVHhVfBCGZYS1JxP8oXYHwim1L7QIzYsfI\r\nCiYnJ795094p/5fF2XrUWne8ju+a56HoQduxbPQDWcoxVx4DBr0abUnXnj6p\r\n5zoTmrwHj/vNcglNGS5ZAnDF/X+FPagt/TKKlvCmq4oDgcm6dSZDq6EBOwDh\r\nPtiybPSyfh5HFFa9i6c/MPZ/+mhSYIwfvgn4VYcgj4tPytVA17HpDEocAkdf\r\nHO0ea9blLOjiaeS3Hqcd+E/dztUM4C0dYZrBGoM1BOrcxJLVatav+NgmjXeC\r\nwUg364QF6G/DFBXl+wbQlU4JxVG5w3U9MIwD4osB4OHMV8OaitT8RmhatBSh\r\nnIWRmjDlZhgyAJGBIKzytEd+7xmtErLCFI8wrFRLnqdpZVCU2rcQUAWfJhM1\r\nypTEaxwWoo1Osd6cMjHwBJNjPWGxfDUHSzUlWXgjV+IQkKPwW/4zyYPbUcZU\r\nVb7qYB42WOidCkV70k45uRH2OefGeWS8B3VmUYQVTS7Iyc0G/nSs5ZP+53W/\r\nEYu/s0x72zKOQj1SN3bKXVgGj4+t46wHc6W2MN5THE02xGVMnttC9Buf959v\r\nCDqy90pAK8oxs40IDgeBjliIwvBa/hIm5iU=\r\n=KnVT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jamietanna","email":"jamie@jamietanna.co.uk"},"directories":{},"maintainers":[{"name":"jamietanna","email":"jamie@jamietanna.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spectral-test-harness_0.3.0_1679515694345_0.6706433425911675"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-23T09:03:45.732Z","0.1.0":"2021-12-23T09:03:45.952Z","modified":"2023-03-22T20:08:14.741Z","0.1.1":"2021-12-23T10:14:08.167Z","0.1.2-0":"2021-12-23T10:27:41.584Z","0.2.0":"2022-01-04T16:07:38.981Z","0.3.0":"2023-03-22T20:08:14.534Z"},"maintainers":[{"name":"jamietanna","email":"jamie@jamietanna.co.uk"}],"description":"A test harness for validation of Spectral API linting rules","homepage":"https://gitlab.com/jamietanna/spectral-test-harness#readme","keywords":["spectral","test","linting"],"repository":{"type":"git","url":"git+https://gitlab.com/jamietanna/spectral-test-harness.git"},"author":{"name":"Jamie Tanna"},"bugs":{"url":"https://gitlab.com/jamietanna/spectral-test-harness/issues"},"license":"Apache-2.0","readme":"# Spectral Test Harness\n\nA test harness to make it easier to write tests for your [Spectral](https://github.com/stoplightio/spectral) API linting rules.\n\n## Install\n\nTo install it for the current project, as a development-only dependency:\n\n```sh\nnpm install --save-dev @jamietanna/spectral-test-harness\n```\n\n## Usage\n\nAn example project can be found [on GitLab at jamietanna/spectral-jest](https://gitlab.com/jamietanna/spectral-jest).\n\nThis project is somewhat opinionated, and expects the following hierarchy:\n\n```\ntest\n├── rules.test.js\n├── semver.test.js\n└── testdata\n    ├── complete\n    │   └── valid.yaml\n    └── semver\n        ├── invalid.yaml\n        └── valid.yaml\n\n3 directories, 5 files\n```\n\nThen within the `semver.test.js`:\n\n```javascript\nconst { retrieveDocument, setupSpectral, resultsForCode } = require('@jamietanna/spectral-test-harness')\n\ndescribe('semver', () => {\n  test('fails when not a number', async () => {\n    const spectral = await setupSpectral('ruleset.yaml')\n    const document = retrieveDocument('semver/invalid.yaml')\n\n    const results = resultsForCode(await spectral.run(document), 'semver')\n\n    expect(results.length).toBeGreaterThanOrEqual(1)\n  })\n\n  test('passes when valid format', async () => {\n    const spectral = await setupSpectral('ruleset.yaml')\n    const document = retrieveDocument('semver/valid.yaml')\n\n    const results = resultsForCode(await spectral.run(document), 'semver')\n\n    expect(results).toHaveLength(0)\n  })\n})\n```\n\nTo test the following ruleset:\n\n```yaml\nextends:\n  - spectral:oas\nrules:\n  # via https://github.com/openapi-contrib/style-guides/blob/c5326037027afb8bd0ce5a5d4ad88be7b048ef64/openapi.yml\n  semver:\n    severity: error\n    recommended: true\n    message: Please follow semantic versioning. {{value}} is not a valid version.\n    given: $.info.version\n    then:\n      function: pattern\n      functionOptions:\n        match: \"^([0-9]+.[0-9]+.[0-9]+)$\"\n```\n\n## FAQs\n\n### Jest `Cannot find module 'nimma/legacy'`\n\nIf you're hitting an issue like the below:\n\n```\n FAIL  test/rules.test.js\n  ● Test suite failed to run\n\n    Cannot find module 'nimma/legacy' from '../spectral-test-harness/node_modules/@stoplight/spectral-core/dist/runner/runner.js'\n\n    Require stack:\n      /home/jamie/workspaces/jvt.me/tmp/spectral-test-harness/node_modules/@stoplight/spectral-core/dist/runner/runner.js\n      /home/jamie/workspaces/jvt.me/tmp/spectral-test-harness/node_modules/@stoplight/spectral-core/dist/runner/index.js\n      /home/jamie/workspaces/jvt.me/tmp/spectral-test-harness/node_modules/@stoplight/spectral-core/dist/spectral.js\n      /home/jamie/workspaces/jvt.me/tmp/spectral-test-harness/node_modules/@stoplight/spectral-core/dist/index.js\n      /home/jamie/workspaces/jvt.me/tmp/spectral-test-harness/index.js\n      test/rules.test.js\n\n      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)\n      at Object.<anonymous> (../spectral-test-harness/node_modules/@stoplight/spectral-core/src/runner/runner.ts:9:1)\n```\n\nThis is caused by Jest only supporting [package exports](https://nodejs.org/docs/latest-v12.x/api/packages.html#packages_exports) in version 28.0.0 or later, so if you are using an older version you will need to upgrade. \n","readmeFilename":"README.md"}