mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 03:27:03 +03:00
Add testing action
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -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
20
.github/workflows/tests.yml
vendored
Normal 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
|
||||
@@ -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
2234
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user