linkedom
jsdom
Our great sponsors
linkedom | jsdom | |
---|---|---|
10 | 28 | |
823 | 17,369 | |
- | 1.0% | |
8.2 | 6.4 | |
13 days ago | 21 days ago | |
HTML | JavaScript | |
ISC License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
linkedom
-
The Fetch API is finally coming to Node.js
I recently started using linkedom for this and it has been an absolute joy
- LinkeDOM: A Jsdom Alternative (2021)
-
Happy-DOM: a jsdom alternative that can server side render web components
This looks great. I wonder how it compares to linkedom (repo[1], writeup[2]), which I have found to be fantastic.
[1]: https://github.com/WebReflection/linkedom
[2]: https://webreflection.medium.com/linkedom-a-jsdom-alternativ...
-
Testing Solid.js code beyond jest
linkedom, fastest, but lacks essential features
-
Using Mocha to test ClojureScript
Other things to do would be to use linkedom instead of JSDom, look into a better assertion library than assert etc.
-
Idiosyncrasies of the HTML Parser
Sounds somewhat similar to linkedom[1], which performs nicely.
- LinkeDOM – A triple-linked lists based DOM“ [Live with Andrea Giammarchi]
- LinkeDOM: A Jsdom Alternative
- LinkeDOM - A faster, ESModule friendly, and more readable alternative to JSDOM
jsdom
-
Error: Not implemented: HTMLFormElement.prototype.submit
const renderCard = ({ onSubmit = jest.fn(),}: RenderCardParams = {}) => { return render( Save , );}; it("should invoke onSubmit when form is submitted", async () => { const onSubmit = jest.fn(); window.HTMLFormElement.prototype.submit = () => {}; const { getByText } = renderCard({ onSubmit }); const button = getByText("Save").closest("button"); if (button) { fireEvent.click(button); } await wait(() => expect(onSubmit).toHaveBeenCalled()); }); I am receiving "Error: Not implemented: HTMLFormElement.prototype.submit". I tried the solution mentioned here https://github.com/jsdom/jsdom/issues/1937 , but it did not work. I do not want to silence the errors but implement the test correctly. Thank you.
-
PurgeCSS & styled-components: Does It Work?
This project is very interesting. It actually solves the problem of excess CSS the best; it does so by loading your HTML into jsdom, and then querySelector-ing all of the selectors found in your CSS against the emulated DOM. If a selector isn't found in the emulated DOM, UnCSS will not include the CSS rule in its output.
-
Robin: An XML/HTML Parser and Library
You should probably add a section to the README explaining why this is useful compared to the alternatives. For example, DOMParser which is built into a web browser, or JSDOM which is the most popular and comprehensive Node in-memory DOM implementation.
- Mesh Importing
-
How to test a component with a nested container with React and Redux?
Due to the complexity of the application I am working on I have decided on using a nested redux container rather than passing an action as a prop down to the child components. However, this has proved to be problematic for unit testing when rendering the OuterContainer with jsdom in combination with mocha, chai and sinon.
-
Setup Jest to React Typescript Vite project, also SWC (part 1)
Everything you want to do to your test environment such as extends the jest matchers with @testing-library/jest-dom, mock some APIs that’s not implemented in jdom, you can put to config/jest/setupTests.js:
-
Testing your Solid.js code in vitest
You may have heard of vite, the slim fast dev server that scored an amazing as deserved 98% satisfaction on the state of js survey 2021. It's creators found unit testing too cumbersome and slow and decided to add their own perspective to the task. The result is vitest: it runs a vite server under the hood to transform the code to test as fast as possible, uses an enhanced flavor of chai to have jest-compatible assertions, integrates DOM mocking using jsdom or happy-dom and even the tiny-spy library that was just built as a separate library to allow for easy reuse is small and compatible with jest.
-
Emulating dom server side?
I think jsdom is what you want to look into. https://github.com/jsdom/jsdom
-
Testing Solid.js code beyond jest
jsdom, full-featured, but slow, the default option in jest
-
Developing and Testing Web Components
The next consideration I addressed was being able to easily write and run unit tests for vue-uhtml components. Having previously talked about a unit testing approach for Vue.js components, I was keen to apply the principle of “writing tests that assert your component’s public interface”. Before I could even think about writing component tests, I had to pick the most appropriate and well supported tooling. Vue’s documentation on testing and own vue-test-utils package makes this choice a foregone conclusion with Jest as a comprehensive test framework, and using vue-test-util’s wrapper based API to mount components in an isolated jsdom environment. While jsdom has provided a Custom Elements implementation since version 16, other Web Components APIs including Shadow DOM are not supported or reliable enough to be useful.
What are some alternatives?
cheerio - Fast, flexible, and lean implementation of core jQuery designed specifically for the server.
happy-dom - Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
Electron - :electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
webworker-threads - Lightweight Web Worker API implementation with native threads
Prettyprint Object - Function to pretty-print an object with an ability to annotate every value.
vite - Next generation frontend tooling. It's fast!
simplecrawler - Flexible event driven crawler for node.
HTMLKit - An Objective-C framework for your everyday HTML needs.
clipboardy - Access the system clipboard (copy/paste)
react-testing-library - 🐐 Simple and complete React DOM testing utilities that encourage good testing practices.
CalDOM - An agnostic, reactive & minimalist (3kb) JavaScript UI library with direct access to native DOM.