From ddaa961db44f736b27f890a09dffa0c71f5a7568 Mon Sep 17 00:00:00 2001 From: Prasana Kannan Date: Sun, 4 Aug 2024 14:37:41 +0000 Subject: [PATCH] updated the example command and package.json --- package.json | 4 ++-- src/example/index.ts | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) 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(() => {