diff --git a/package.json b/package.json index 1798a61..b24b51d 100644 --- a/package.json +++ b/package.json @@ -95,9 +95,9 @@ "doc:html": "typedoc src/ --exclude **/*.spec.ts --excludePrivate --target ES6 --mode file --out build/docs", "doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs", "version": "standard-version", - "reset-hard": "git clean -dfx && yarn i", + "reset-hard": "git clean -dfx && yarn ci", "prepare-release": "run-s test doc:html version doc:publish", - "ci": "run-s reset-hard doc:html version doc:publish" + "ci": "run-s doc:html version doc:publish" }, "engines": { "node": ">=16" diff --git a/src/example/index.ts b/src/example/index.ts index 424c31a..bd97e09 100644 --- a/src/example/index.ts +++ b/src/example/index.ts @@ -1,6 +1,3 @@ -import fs from 'fs'; -import { PassThrough } from 'stream'; - import puppeteer from 'puppeteer'; import { PuppeteerScreenRecorder } from '../lib/PuppeteerScreenRecorder'; @@ -13,7 +10,7 @@ function sleep(time: number) { } /** @ignore */ -async function testStartMethod(format: string, isStream: boolean) { +async function testStartMethod(format: string) { const executablePath = process.env['PUPPETEER_EXECUTABLE_PATH']; const browser = await puppeteer.launch({ ...(executablePath ? { executablePath: executablePath } : {}), @@ -27,7 +24,7 @@ async function testStartMethod(format: string, isStream: boolean) { deviceScaleFactor: 1, }); - await recorder.start('./report/video/simple1.mp4'); + await recorder.start(format); await page.goto('https://developer.mozilla.org/en-US/docs/Web/CSS/animation'); await sleep(10 * 1000); @@ -37,13 +34,7 @@ async function testStartMethod(format: string, isStream: boolean) { } async function executeSample(format) { - const argList = process.argv.slice(2); - const isStreamTest = argList.includes('stream'); - - console.log( - `Testing with Method using ${isStreamTest ? 'stream' : 'normal'} mode` - ); - return testStartMethod(format, isStreamTest); + return testStartMethod(format); } executeSample('./report/video/simple1.mp4').then(() => {