Add testing action

This commit is contained in:
Ajay Ramachandran
2021-10-02 17:42:47 -04:00
parent 8605e23fbb
commit 0e147134f3
6 changed files with 2076 additions and 198 deletions

View File

@@ -12,7 +12,9 @@ jobs:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
with:
node-version: '16'
- run: npm ci
- name: Copy configuration
run: cp config.json.example config.json

View File

@@ -14,7 +14,9 @@ jobs:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
with:
node-version: '16'
- run: npm ci
- name: Copy configuration
run: cp config.json.example config.json

20
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Tests
on: [push, pull_request]
jobs:
build:
name: Run tests
runs-on: ubuntu-latest
steps:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm ci
- name: Run tests
run: npm run test-without-building

View File

@@ -60,6 +60,8 @@ You can read the API docs [here](https://wiki.sponsor.ajay.app/index.php/API_Doc
# Building
You must have Node.js 16 installed.
Rename `config.json.example` to `config.json` and adjust configuration as desired.
There are also other build scripts available. Install `npm`, then run `npm install` in the repository to install dependencies.

2234
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,15 @@ import * as Chrome from "selenium-webdriver/chrome";
import * as Path from "path";
test("Selenium Chrome test", async () => {
const driver = await setup();
let driver;
try {
driver = await setup();
} catch (e) {
console.warn("A browser is probably not installed, skipping selenium tests");
console.warn(e);
return;
}
try {
await waitForInstall(driver);