Skip to content

This repository contains a set of frontend apps to test with.

Notifications You must be signed in to change notification settings

appsignal/frontend-test-setups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppSignal frontend test setups

This repository contains a set of frontend apps to test with.

Setup

Make sure you have have a working local Node.js install. The Node.js version should match the one in the .tool-versions file.

The yarn package manager should be globally installed:

npm i -g yarn

Install the dependencies with bundle:

bundle install

Get started by adding a push and frontend key:

cp keys.example.yml keys.yml

Open this file and follow the instructions.

Usage

To install an app:

rake app:install app=angular/13
rake app:install app=angular/14
rake app:install app=react/cra-16
rake app:install app=react/cra-17
rake app:install app=react/cra-17-typescript
rake app:install app=react/cra-18
rake app:install app=react/vite-18
rake app:install app=stimulus/3
rake app:install app=vue/2
rake app:install app=vue/3
rake app:install app=vue/3-class-component

To run an app and upload its sourcemaps:

rake app:run app=angular/13 revision=<revision>
rake app:run app=angular/14 revision=<revision>
rake app:run app=react/cra-16 revision=<revision>
rake app:run app=react/cra-17 revision=<revision>
rake app:run app=react/cra-17-typescript revision=<revision>
rake app:run app=react/cra-18 revision=<revision>
rake app:run app=react/vite-18 revision=<revision>
rake app:run app=stimulus/3 revision=<revision>
rake app:run app=vue/2 revision=<revision>
rake app:run app=vue/3 revision=<revision>
rake app:run app=vue/3-class-component revision=<revision>

Then navigate to http://localhost:5001 to trigger an error.

Running tests

To run the tests, you must have geckodriver installed:

brew install geckodriver

To run an integration test on all test setups:

bundle exec rspec

Adding a new app

You can add a new test app in one of the framework directories. Add this line to import a configured Appsignal instance:

import appsignal from "./appsignal.js"

Make sure to use wildcard dependencies in package.json. Specify the major version of the framework you're using, for example =2 or =3.

For the tests to pass a test app should throw a JS error on /:

throw new Error("This is an error")

This error should be caught by the app, the app should render the following text:

An error was thrown

Linking a local integration checkout

To do local testing checkout the integrations somewhere, and run mono bootstrap in the directory. Then run:

rake link

This will link the local packages into all the test setups.

Whenever you make changes to the integrations run mono build. If this is done running apps works in the usual manner.

To undo this step and unlink the packages run:

rake unlink

About

This repository contains a set of frontend apps to test with.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published