Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
1.9 KiB
Plaintext
1 line
1.9 KiB
Plaintext
{"version":3,"sources":["../../src/utilities/formatLabels.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { formatLabels, toWords } from './formatLabels'\n\ndescribe('formatLabels', () => {\n it('should format singular slug', () => {\n expect(formatLabels('word')).toMatchObject({\n plural: 'Words',\n singular: 'Word',\n })\n })\n\n it('should format plural slug', () => {\n expect(formatLabels('words')).toMatchObject({\n plural: 'Words',\n singular: 'Word',\n })\n })\n\n it('should format kebab case', () => {\n expect(formatLabels('my-slugs')).toMatchObject({\n plural: 'My Slugs',\n singular: 'My Slug',\n })\n })\n\n it('should format camelCase', () => {\n expect(formatLabels('camelCaseItems')).toMatchObject({\n plural: 'Camel Case Items',\n singular: 'Camel Case Item',\n })\n })\n\n describe('toWords', () => {\n it('should convert camel to capitalized words', () => {\n expect(toWords('camelCaseItems')).toBe('Camel Case Items')\n })\n\n it('should allow no separator (used for building GraphQL label from name)', () => {\n expect(toWords('myGraphField', true)).toBe('MyGraphField')\n })\n })\n})\n"],"names":["describe","it","expect","formatLabels","toWords","toMatchObject","plural","singular","toBe"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,SAAQ;AAC7C,SAASC,YAAY,EAAEC,OAAO,QAAQ,iBAAgB;AAEtDJ,SAAS,gBAAgB;IACvBC,GAAG,+BAA+B;QAChCC,OAAOC,aAAa,SAASE,aAAa,CAAC;YACzCC,QAAQ;YACRC,UAAU;QACZ;IACF;IAEAN,GAAG,6BAA6B;QAC9BC,OAAOC,aAAa,UAAUE,aAAa,CAAC;YAC1CC,QAAQ;YACRC,UAAU;QACZ;IACF;IAEAN,GAAG,4BAA4B;QAC7BC,OAAOC,aAAa,aAAaE,aAAa,CAAC;YAC7CC,QAAQ;YACRC,UAAU;QACZ;IACF;IAEAN,GAAG,2BAA2B;QAC5BC,OAAOC,aAAa,mBAAmBE,aAAa,CAAC;YACnDC,QAAQ;YACRC,UAAU;QACZ;IACF;IAEAP,SAAS,WAAW;QAClBC,GAAG,6CAA6C;YAC9CC,OAAOE,QAAQ,mBAAmBI,IAAI,CAAC;QACzC;QAEAP,GAAG,yEAAyE;YAC1EC,OAAOE,QAAQ,gBAAgB,OAAOI,IAAI,CAAC;QAC7C;IACF;AACF"} |