UNPKG

5.01 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/index.test.js"],"names":["VERSION_MESSAGES","AMENDMENTS","AMENDED_VERSION_MESSAGES","reduce","results","message","map","amendment","t","false","true","forEach"],"mappings":";;;;;;AAAA;;;;AACA;;;;;;AAEA,IAAMA,mBAAmB,CACxB,OADwB,EAExB,OAFwB,EAGxB,OAHwB,EAIxB,aAJwB,EAKxB,sBALwB,EAMxB,SANwB,EAOxB,WAPwB,EAQxB,eARwB,EASxB,iBATwB,EAUxB,wBAVwB,EAWxB,0BAXwB,EAYxB,eAZwB,EAaxB,QAbwB,EAcxB,SAdwB,CAAzB;;AAiBA,IAAMC,aAAa,CAClB,gDADkB,EAElB,sDAFkB,EAGlB,sGAHkB,CAAnB;;AAMA,IAAMC,2BAA2BF,iBAAiBG,MAAjB,CAAwB,UAACC,OAAD,EAAUC,OAAV,EAAsB;AAC9E,mDACID,OADJ,oCAEIH,WAAWK,GAAX,CAAe;AAAA,SAAc,GAAED,OAAQ,OAAME,SAAU,EAAxC;AAAA,EAAf,CAFJ;AAIA,CALgC,EAK9B,EAL8B,CAAjC;;AAOA,mBAAK,mDAAL,EAA0D,aAAK;AAC9DC,GAAEC,KAAF,CAAQ,iBAAR;AACA,CAFD;;AAIA,mBAAK,mDAAL,EAA0D,aAAK;AAC9DD,GAAEC,KAAF,CAAQ,gBAAU,EAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,uCAAL,EAA8C,aAAK;AAClDD,GAAEC,KAAF,CAAQ,gBAAU,gBAAV,CAAR;AACA,CAFD;;AAIA,mBAAK,sCAAL,EAA6C,aAAK;AACjDD,GAAEE,IAAF,CAAO,gBAAU,sBAAV,CAAP;AACA,CAFD;;AAIA,mBAAK,8DAAL,EAAqE,aAAK;AACzEF,GAAEE,IAAF,CAAO,gBAAU,kCAAV,CAAP;AACAF,GAAEE,IAAF,CAAO,gBAAU,oCAAV,CAAP;AACA,CAHD;;AAKA,mBAAK,uEAAL,EAA8E,aAAK;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0.1-some-crazy-tag',\n\t'0.0.1-0',\n\t'0.0.1-999',\n\t'0.0.1-alpha.0',\n\t'0.0.1-alpha.999',\n\t'0.0.1-some-crazy-tag.0',\n\t'0.0.1-some-crazy-tag.999',\n\t'0.0.1-1e69d54',\n\t'v0.0.1',\n\t' v3.0.0'\n];\n\nconst AMENDMENTS = [\n\t'Signed-off-by: Developer <example@example.com>',\n\t'Change-Id: I895114872a515a269487a683124b63303818e19c',\n\t'Signed-off-by: Developer <example@example.com>\\nChange-Id: I895114872a515a269487a683124b63303818e19c'\n];\n\nconst AMENDED_VERSION_MESSAGES = VERSION_MESSAGES.reduce((results, message) => {\n\treturn [\n\t\t...results,\n\t\t...AMENDMENTS.map(amendment => `${message}\\n\\n${amendment}`)\n\t];\n}, []);\n\ntest('should return false when called without arguments', t => {\n\tt.false(isIgnored());\n});\n\ntest('should return false when called with empty string', t => {\n\tt.false(isIgnored(''));\n});\n\ntest('should return false for normal commit', t => {\n\tt.false(isIgnored('initial commit'));\n});\n\ntest('should return true for branch merges', t => {\n\tt.true(isIgnored(\"Merge branch 'iss53'\"));\n});\n\ntest('should return true for branch merges with newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\"));\n});\n\ntest('should return true for branch merges with multiple newline characters', t => {\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\n\\n\\n\"));\n\tt.true(isIgnored(\"Merge branch 'ctrom-YarnBuild'\\r\\n\\r\\n\\r\\n\"));\n});\n\ntest('should return true for merged PRs', t => {\n\tt.true(isIgnored('Merge pull request #369'));\n});\n\ntest('should return true for revert commits', t => {\n\tt.true(\n\t\tisIgnored(\n\t\t\t`Revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n\tt.true(\n\t\tisIgnored(\n\t\t\t`revert \"docs: add recipe for linting of all commits in a PR (#36)\"\\n\\nThis reverts commit 1e69d542c16c2a32acfd139e32efa07a45f19111.`\n\t\t)\n\t);\n});\n\ntest('should ignore npm semver commits', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should ignore npm semver commits with chore', t => {\n\tVERSION_MESSAGES.forEach(message => t.true(isIgnored(`chore: ${message}`)));\n\tVERSION_MESSAGES.forEach(message =>\n\t\tt.true(isIgnored(`chore(release): ${message}`))\n\t);\n});\n\ntest('should ignore npm semver commits with footers', t => {\n\tAMENDED_VERSION_MESSAGES.forEach(message => t.true(isIgnored(message)));\n});\n\ntest('should return true fixup commits', t => {\n\tt.true(isIgnored('fixup! initial commit'));\n});\n\ntest('should return true squash commits', t => {\n\tt.true(isIgnored('squash! initial commit'));\n});\n"]}
\No newline at end of file