Skip to content

LearnHyperapp/hyperapp-cypress-demo

Repository files navigation

Hyperapp Cypress Demo

Slack

What is it?

This code demonstrates how to test a hyperapp project. Originally adapted from Mini Todo App. This is the code I worked on while live streaming, which you can watch here.

Installation

Clone the repo and use npm or yarn to install dependencies.

git clone https://github.com/LearnHyperapp/hyperapp-cypress-demo
cd hyperapp-demo
npm i

Usage

There are two scripts provided in package.json: start, and test.

npm start will start the app on localhost:8080. This needs to be running for Cypress to use it.

yarn test will start the cypress application. This will open a window so you can control which spec files are being ran. When you run a spec file test, it will load a new controlled instance of Chrome. From there, you will have an interface to see the results from tests, as well as an iframe of your app.

Tests

Tests are using start-server-and-test utility to start webpack dev server, run Cypress then shutdown the server.

To run tests in the interactive mode a single command starts the server and opens Cypress GUI

npm test

To run tests on CI in non-interactive mode use the following command.

npm run ci

end to end tests

These tests assume the server is running and the page locahost:8080 has the application page

integration tests

These tests exercise individual view functions like TodoItem by mounting it as a "mini web app" and then using Cypress to interact with them

unit tests

These tests do not require DOM, but Cypress can run them anyway

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published