Coder Social home page Coder Social logo

hyperhtml-serializer's Introduction

hyperhtml-serializer

CI NPM version Conventional Commits codecov

Jest snapshot serializer that beautifies hyperHTML snapshots.

Note

This version is working with hyperhtml version >=2.19
For [email protected] - 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 <[email protected]>
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.

hyperhtml-serializer's People

Contributors

dependabot[bot] avatar douglasduteil avatar renovate-bot avatar renovate[bot] avatar

Watchers

 avatar  avatar  avatar

hyperhtml-serializer's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4
npm
package.json
  • hyperhtml ^2.34.2
  • jest ^29.7.0
  • jest-environment-jsdom ^29.7.0
  • standard-version ^9.5.0
  • hyperhtml >=2.19

  • Check this box to trigger a request for Renovate to run again on this repository

hyperhtml changed its comment format

I'm using hypermorphic v0.9.0 and this serializer wasn't removing comments.
I've looked into it and apparently hyperhtml changed its comment format.
I've forked your repo and changed the regular expression. I'll send a pull request momentarily.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.