Coder Social home page Coder Social logo

silbinarywolf / cypress-aurelia-unit-test Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 1.2 MB

This is a library designed to feel like the official aurelia/testing library but instead it is built to work with Cypress.

License: MIT License

TypeScript 84.86% JavaScript 11.42% HTML 3.53% CSS 0.19%

cypress-aurelia-unit-test's Introduction

Cypress Aurelia Unit Test

Build Status npm Version

This is a library designed to feel like the official aurelia/testing library but instead it is built to work with Cypress. The purpose of this module is so that components can be visually unit tested as close to reality as possible, ie. in a browser rather than in NodeJS with a virtual DOM.

Known Limitations

  • viewModel is undefined in Cypress if a component has been annotated with @containerless.
  • Appending elements directly to the document.body may not work as expected due to the fact that Cypress sandboxes it's test code and application code into seperate iframes as it was not currently designed for you to import components directly. To work around this limitation there is currently some code in place which overrides the functionality of the following methods to redirect calls to the main application iframe.
    • document.addEventListener
      • This was added to fix click.delegate so that click events were processed as expected.
    • document.appendChild
    • document.querySelector
    • document.querySelectorAll
    • document.body.appendChild
    • document.body.querySelector
    • document.body.querySelectorAll

Credits

  • Gleb Bahmutov for their Cypress React Unit Test library. It helped me figure out how to get styles working quickly.

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.