custom-prefix.spec.js 411 B

12345678910111213141516
  1. import { haveText, html, test } from '../utils'
  2. test('can set a custom x- prefix',
  3. html`
  4. <script>
  5. document.addEventListener('alpine:init', () => {
  6. Alpine.prefix('data-x-')
  7. })
  8. </script>
  9. <div data-x-data="{ foo: 'bar' }">
  10. <span data-x-text="foo"></span>
  11. </div>
  12. `,
  13. ({ get }) => get('span').should(haveText('bar'))
  14. )