UNPKG

dbl-utils

Version:

Utilities for dbl, adba and others projects

1 lines 1.09 kB
{"file":"/home/diablo/dev/dbl-utils/__tests__/extract-react-node-text.test.ts","mappings":";;;;;AAAA,kDAA0B;AAC1B,4EAAmE;AAEnE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,EAAE,GAAG,eAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EACxC,QAAQ,EACR,eAAK,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAC3C,CAAC;QACF,MAAM,IAAI,GAAG,IAAA,2CAAiB,EAAC,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/D,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","names":[],"sources":["/home/diablo/dev/dbl-utils/__tests__/extract-react-node-text.test.ts"],"sourcesContent":["import React from 'react';\nimport { extractNodeString } from '../src/extract-react-node-text';\n\ndescribe('extractNodeString', () => {\n it('collects text from React elements', () => {\n const el = React.createElement('div', null,\n 'Hello ',\n React.createElement('span', null, 'World')\n );\n const text = extractNodeString(el).replace(/\\s+/g, ' ').trim();\n expect(text).toBe('Hello World');\n });\n});\n"],"version":3}