All Projects → jsdom → jsdom-devtools-formatter

jsdom / jsdom-devtools-formatter

Licence: other
Make jsdom elements look like real DOM elements in Chrome Devtools console

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jsdom-devtools-formatter

Js Leakage Patterns
🎯这是关于JavaScript内存泄露和CSS优化相关序列文章,相信你读完会有所收获的✈️
Stars: ✭ 756 (+1790%)
Mutual labels:  chrome-devtools, dom
Jest Dom
🦉 Custom jest matchers to test the state of the DOM
Stars: ✭ 2,908 (+7170%)
Mutual labels:  dom, jsdom
debug.js
Debugger of JavaScript, by JavaScript, for JavaScript
Stars: ✭ 19 (-52.5%)
Mutual labels:  dom, debug
Ololog
A better console.log for the log-driven debugging junkies
Stars: ✭ 141 (+252.5%)
Mutual labels:  chrome-devtools, debug
zebrajs
A modular, jQuery compatible, ultra light-weight JavaScript micro-library for modern browsers
Stars: ✭ 26 (-35%)
Mutual labels:  dom
sendmessage
SendMessage is a little tool to send Windows messages to any window.
Stars: ✭ 93 (+132.5%)
Mutual labels:  debug
anime-scraper
[partially working] Scrape and add anime episode stream URLs to uGet (Linux) or IDM (Windows) ~ Python3
Stars: ✭ 21 (-47.5%)
Mutual labels:  chrome-devtools
rottenjs
An all-in-one (2.6kb) Javascript library for web development
Stars: ✭ 15 (-62.5%)
Mutual labels:  dom
go-xmldom
XML DOM processing for Golang, supports xpath query
Stars: ✭ 38 (-5%)
Mutual labels:  dom
sdebug
Xdebug — Step Debugger and Debugging Aid for PHP
Stars: ✭ 263 (+557.5%)
Mutual labels:  debug
cheatsheets
📋 Various cheatsheets made while working as a developer
Stars: ✭ 22 (-45%)
Mutual labels:  dom
consono
The most correct, informative, appealing and configurable variable inspector for JavaScript
Stars: ✭ 17 (-57.5%)
Mutual labels:  debug
golang-debugger-book
From a debugger's view, Let's explore the computer world! How does compiler, linker and debugger coordinate with each other around the program written in specific programming language? How does a debugger work? If we develop a debugger for go programming language, we must master go type system, runtime... and some Operating System internals. OK,…
Stars: ✭ 49 (+22.5%)
Mutual labels:  debug
react-native-debug-server-host
React Native Debug server host for iOS
Stars: ✭ 45 (+12.5%)
Mutual labels:  debug
ngx-event-modifiers
Event Modifiers for Angular Applications https://netbasal.com/implementing-event-modifiers-in-angular-87e1a07969ce
Stars: ✭ 14 (-65%)
Mutual labels:  dom
zero-drag
Minimal abstraction of DOM drag-and-drop interactions
Stars: ✭ 17 (-57.5%)
Mutual labels:  dom
theBookOfNoah
Everything ive learned developing web applications
Stars: ✭ 22 (-45%)
Mutual labels:  dom
move-into-view
move-into-view is such as sroll-into-view but better
Stars: ✭ 33 (-17.5%)
Mutual labels:  dom
vanilla-jsx
Vanilla jsx without runtime. HTML Tag return DOM in js, No virtual DOM.
Stars: ✭ 70 (+75%)
Mutual labels:  dom
flutter debug drawer
Adds a side menu in all screens with debug information. You can decide which information to show and create new modules to include more information.
Stars: ✭ 26 (-35%)
Mutual labels:  debug

jsdom-devtools-formatter Build Status

In a nutshell: Instead of trying to understand what jsdom's elements represents by inspecting their implementation objects like so: before.png

…let's just inspect them like they were real HTML elements: after.png

Typical use-case would be some script/test that utilizes jsdom in a Node.js environment, e.g. Jest.

How to use

npm install jsdom-devtools-formatter
// in some file.js
const jsdomDevtoolsFormatter = require('jsdom-devtools-formatter');
jsdomDevtoolsFormatter.install();

// You can also opt-out at some later point by:
jsdomDevtoolsFormatter.uninstall();

E.g. for Jest it's probably easiest to integrate through setupTestFrameworkScriptFile configuration.

As a one-time thing also need to:

  • Open Chrome's Devtools
  • Click the "⠇" in the upper-right corner > Settings
  • Under "Console", check "Enable custom formatters"

Development

The source code is all plain vanilla JS and standard CommonJS modules. Tests are written using Jest

See package.json's scripts sections for all available commands. The most useul ones are probably:

# run all tests once:
npm test

# run tests in "watch mode"
npm test -- --watch

Testing

In addition to verifying logical changes using the automated tests, it's recommended to verify that things "look & feel" as expected using the manual tests:

  • Open chrome://inspect and click the "Open dedicated DevTools for Node" link (one-time thing)
  • Then run one of the following commands
npm run test:manual_node
# -or-
npm run test:manual_jest

It should stop at the debugger call, from there you can follow the inlined comment with instructions to play with the console output.

Related resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].