question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test runner transformation

See original GitHub issue

Another idea that lends itself well to Preact’s vnode abstraction is a super easy way to create frontend integration tests.

You could have something like this:

index.js:

const App = module.exports = (props) => {
  <div class="App">
     <button class="login" onClick={onClick}>Click Me!</button>
  </div>
}

test.js:

// This would walk the vnodes, and build a selector list along with their handlers
let $ = Runner(require('./app')(testProps))

// query the selector list and then trigger the handler
$('.login').click(e) // optional "e" that you could pass through

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
developitcommented, Aug 29, 2016

@matthewmueller yes!! This is similar to enzyme, just lighter. Super high on my to-do list! That was actually why I wrote undom, as the faked rendering target that can still be queried and asserted on like a DOM.

0reactions
marvinhagemeistercommented, Mar 4, 2018

If anyone stumbles upon this issue, we have great guide on how to use preact with enzyme on our main site: https://preactjs.com/guide/unit-testing-with-enzyme

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Transformation: A viable option for all companies
An intuitive dashboard provides a comprehensive management framework with a focus on test metrics and business priorities. An effective model spells out a...
Read more >
Running the Transformation Test Utility - Oracle Help Center
Running the Transformation Test Utility ; Source Node. Enter the name of the node whose codeset group defines the structure of the input...
Read more >
How to test a transformation in Palantir Foundry?
We try to create a test function for the whole transformation. import os from transforms.verbs.testing.TransformRunner import ...
Read more >
Web Test Runner
Test runner for web applications. ... npm i --save-dev @web/test-runner ... Transform JS to a compatible syntax based on user agent: web-test-runner ......
Read more >
Testing Transformation to 'Beyond Testing' - Capgemini
including a Managed Testing Service (MTS). This has proved to be a robust and effective model for structuring and running a test organization,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found