mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 12:23:24 +00:00
Improve logging of provider unit tests
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
"cli": "ts-node ./src/dev-cli/index.ts",
|
"cli": "ts-node ./src/dev-cli/index.ts",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"test:providers": "cross-env MW_TEST_PROVIDERS=true vitest run",
|
"test:providers": "cross-env MW_TEST_PROVIDERS=true vitest run --reporter verbose",
|
||||||
"test:integration": "node ./tests/cjs && node ./tests/esm && node ./tests/browser",
|
"test:integration": "node ./tests/cjs && node ./tests/esm && node ./tests/browser",
|
||||||
"test:coverage": "vitest run --coverage",
|
"test:coverage": "vitest run --coverage",
|
||||||
"lint": "eslint --ext .ts,.js src/",
|
"lint": "eslint --ext .ts,.js src/",
|
||||||
|
@@ -53,6 +53,7 @@ export function testSource(ops: TestSourceOptions) {
|
|||||||
if (ops.testSuite.length === 0) throw new Error("Test suite must have at least one test");
|
if (ops.testSuite.length === 0) throw new Error("Test suite must have at least one test");
|
||||||
describe(`source:${ops.source.id}`, () => {
|
describe(`source:${ops.source.id}`, () => {
|
||||||
ops.testSuite.forEach((test, i) => {
|
ops.testSuite.forEach((test, i) => {
|
||||||
|
describe(`test ${i}`, () => {
|
||||||
async function runTest(providers: ProviderControls) {
|
async function runTest(providers: ProviderControls) {
|
||||||
let hasNotFound = false;
|
let hasNotFound = false;
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
@@ -109,6 +110,8 @@ export function testSource(ops: TestSourceOptions) {
|
|||||||
await runTest(providers);
|
await runTest(providers);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -117,6 +120,7 @@ export function testEmbed(ops: TestEmbedOptions) {
|
|||||||
if (ops.testUrls.length === 0) throw new Error("Test urls must have at least one url");
|
if (ops.testUrls.length === 0) throw new Error("Test urls must have at least one url");
|
||||||
describe(`embed:${ops.embed.id}`, () => {
|
describe(`embed:${ops.embed.id}`, () => {
|
||||||
ops.testUrls.forEach((test, i) => {
|
ops.testUrls.forEach((test, i) => {
|
||||||
|
describe(`test ${i}`, () => {
|
||||||
async function runTest(providers: ProviderControls) {
|
async function runTest(providers: ProviderControls) {
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
let streamCount = 0;
|
let streamCount = 0;
|
||||||
@@ -165,6 +169,7 @@ export function testEmbed(ops: TestEmbedOptions) {
|
|||||||
await runTest(providers);
|
await runTest(providers);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user