/
test.sh
executable file
·26 lines (20 loc) · 1 KB
/
test.sh
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
#!/bin/bash
set -exuo pipefail
# Generate the package.json to use
node /usr/utils/generate-package-json.js
# Install dependencies
npm install
# Use the local volumes for our own packages
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/typescript-estree | tail -1)
npm install $(npm pack /usr/parser | tail -1)
npm install $(npm pack /usr/experimental-utils | tail -1)
npm install $(npm pack /usr/eslint-plugin | tail -1)
# Install the latest eslint-plugin-markdown (this may break us occassionally, but it's probably good to get that feedback early)
npm install eslint-plugin-markdown@latest
# Run the linting
# (the "|| true" helps make sure that we run our tests on failed linting runs as well)
npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.js /usr/linked/**/*.md || true
# Run our assertions against the linting output
npx jest /usr/test.js --snapshotResolver=/usr/utils/jest-snapshot-resolver.js