Skip to content

Commit

Permalink
updated the example command and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
prasanaworld committed Aug 4, 2024
1 parent 23ee347 commit ddaa961
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 3 additions & 12 deletions src/example/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import fs from 'fs';
import { PassThrough } from 'stream';

import puppeteer from 'puppeteer';

import { PuppeteerScreenRecorder } from '../lib/PuppeteerScreenRecorder';
Expand All @@ -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 } : {}),
Expand All @@ -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);
Expand All @@ -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(() => {
Expand Down

0 comments on commit ddaa961

Please sign in to comment.