summary refs log tree commit diff
path: root/pkgs/development/node-packages/package-tests/autoprefixer.nix
blob: c889795a2ef596faa1dfed65fa628549c9338579 (plain) (blame)
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
{ runCommand, autoprefixer }:

let
  inherit (autoprefixer) packageName version;
in

runCommand "${packageName}-tests" { meta.timeout = 60; }
  ''
    # get version of installed program and compare with package version
    claimed_version="$(${autoprefixer}/bin/autoprefixer --version | awk '{print $2}')"
    if [[ "$claimed_version" != "${version}" ]]; then
      echo "Error: program version does not match package version ($claimed_version != ${version})"
      exit 1
    fi

    # run dummy commands
    ${autoprefixer}/bin/autoprefixer --help > /dev/null
    ${autoprefixer}/bin/autoprefixer --info > /dev/null

    # Testing the actual functionality is done in the test for postcss
    # because autoprefixer is a postcss plugin

    # needed for Nix to register the command as successful
    touch $out
  ''