aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/dashboard/check.nix
blob: 7276768225b978735d5585a9d410c99b017588f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Node.js with Playwright's library and its Chromium, all from nixpkgs, for the
# dashboard's browser checks (`check.js`):
#
#   nix-shell src/api/dashboard/check.nix --run \
#     'cargo test --features most dashboard_in_a_browser -- --ignored'
#
# nixpkgs builds Playwright's library (`playwright-core`) as `playwright-driver`, with
# browsers of its version in `playwright-driver.browsers`: so the two match, and nothing
# comes from npm.
{
  pkgs ? import <nixpkgs> { },
}:
let
  driver = pkgs.playwright-driver;
in
pkgs.mkShell {
  packages = [ pkgs.nodejs ];
  # Where Node finds `require("playwright-core")`.
  NODE_PATH = pkgs.linkFarm "continuum-dashboard-check-modules" [
    {
      name = "playwright-core";
      path = driver;
    }
  ];
  PLAYWRIGHT_BROWSERS_PATH = driver.browsers;
  PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = "true";
}