webapp

package
v0.0.0-...-5ae202f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

README

wpt.fyi

Testing webapp/

Prerequisites:
  1. Setting up your environment
  2. Running locally

Once the above steps are completed, run the following commands from within webapp/:

npm install
Test commands

webapp/ has both lint tests and tests based on web-component-test. There are npm aliases for many of the common tasks, listed below.

  • npm test: This will run the linting task followed by the web-component-tester task.
  • npm run lint: This will run only the linting task.
  • npm run lint-fix: This will run the linting task with automatic lint fixing.
  • npm run wct: This will run only the web-component-tester task.
  • npm run wctp: This will run the web-component-tester task with the -p flag to leave the browser open after the tests have completed.

When using npm run, any additional flags or options will be passed to the underlying command. For example, to run a specific test only on chrome:

  • npm run wct -l chrome path/to/test/test-file.html
Running web_components_test

To run web_components_test in any platform, first start a Docker instance. Once the instance is running, execute the following in another terminal:

source util/commands.sh
wptd_exec make web_components_test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes()

RegisterRoutes adds the route handlers for the webapp.

func RenderTemplate

func RenderTemplate(w http.ResponseWriter, r *http.Request, name string, data interface{})

RenderTemplate renders an HTML template to a response. The provided data will be available in the Data field in the template. There are some additional fields extracted from the request (e.g. User) available in the template if the request is not nil. If an error is encountered, appropriate error codes and messages will be set on the response; do not write additional data to the response after calling this function.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL