dotnet: improve language coverage of passthru.tests for dotnet sdks (#370789)
[NixPkgs.git] / pkgs / development / node-packages / package-tests / tailwindcss.nix
blob53930735af4bbc31971f07556d2350a26741e988
2   runCommand,
3   tailwindcss,
4   nodePackages,
5 }:
7 let
9   inherit (tailwindcss) packageName version;
11   tailwindcssInput = builtins.toFile "input.css" ''
12     @tailwind base;
13     @tailwind components;
14     @tailwind utilities;
15   '';
17   tailwindcssWithPlugins = tailwindcss.overrideAttrs (oldAttrs: {
18     plugins = [
19       nodePackages."@tailwindcss/typography"
20     ];
21   });
23   tailwindcssWithPluginsConfig = builtins.toFile "tailwind.config.js" ''
24     module.exports = {
25       content: ["./with-typography.input"],
26       plugins: [
27         require('@tailwindcss/typography'),
28       ],
29     }
30   '';
34 runCommand "${packageName}-tests" { meta.timeout = 60; } ''
35   mkdir $out
37   # Ensure CLI runs
38   ${tailwindcss}/bin/tailwind --help > /dev/null
39   ${tailwindcss}/bin/tailwindcss --help > /dev/null
41   # Ensure CLI with plugins runs
42   echo '"ml-4 prose"' > ./with-typography.input
43   ${tailwindcssWithPlugins}/bin/tailwind \
44     --config ${tailwindcssWithPluginsConfig} \
45     --input ${tailwindcssInput} \
46     --output $out/with-typography.css
48   grep -q ml-4 $out/with-typography.css
49   grep -q prose $out/with-typography.css