hyperhtml-serializer

2.0.1 • Public • Published

hyperhtml-serializer

CI NPM version Conventional Commits

Jest snapshot serializer that beautifies hyperHTML snapshots.

Note

This version is working with hyperhtml version >=2.19
For hyperhtml@2.4 - 2.18 versions consult the 1.x branch

Why ?

This serializer it made to remove :

  • hyperHTML _hyper comments like <!--_hyper: (\d+);-->

Before :

<foo-hyper-app>
  <!-- This is my comment -->
  <h1>Hello hyperHTML !</h1>
  <!--_hyper: 123546789;-->
  <h1>Hello world !</h1>
  <!--_hyper: 123546789;-->
</foo-hyper-app>

After :

<foo-hyper-app>
  <!-- This is my comment -->
  <h1>Hello hyperHTML !</h1>

  <h1>Hello world !</h1>

</foo-hyper-app>

Install

$ npm install --save-dev hyperhtml-serializer
# or
$ yarn add -D hyperhtml-serializer

Usage

Add in your package.json.

{
  "jest": {
    "snapshotSerializers": ["hyperhtml-serializer"]
  }
}

License

Copyright © 2018 Douglas Duteil <douglasduteil@gmail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENCE file for more details.

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i hyperhtml-serializer

    Weekly Downloads

    1

    Version

    2.0.1

    License

    WTFPL

    Unpacked Size

    3.66 kB

    Total Files

    3

    Last publish

    Collaborators

    • douglasduteil