File: integration-tests.bash

package info (click to toggle)
node-eslint-plugin-html 6.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 696 kB
  • sloc: javascript: 2,011; makefile: 28; sh: 27
file content (38 lines) | stat: -rwxr-xr-x 499 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

set -euo pipefail

ROOT=$(mktemp -d)

function finish {
  rm -rf "$ROOT"
}

trap finish EXIT

REPO_PATH=$(pwd)

cd $ROOT

cat << EOF > index.html
<script>
console.log(1)
</script>
EOF

cat << EOF > .eslintrc.js
module.exports = {
  plugins: ["html"],
  rules: {
    "no-console": "error",
  },
}
EOF

cat << EOF | diff -u <(eslint --format compact index.html 2>&1) -
$(pwd)/index.html: line 2, col 1, Error - Unexpected console statement. (no-console)

1 problem
EOF

echo "All passed"