Bump @justinribeiro/lite-youtube from 0.9.0 to 0.9.1 in /build/javascript (#273)
* Commit updated Javascript packages * Bump preact from 10.5.4 to 10.5.5 in /build/javascript (#265) * Trying a new github workflow to install javascript packages * Bump tailwindcss from 1.9.2 to 1.9.4 in /build/javascript (#266) Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 1.9.2 to 1.9.4. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v1.9.2...v1.9.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Commit updated Javascript packages * Bump preact from 10.5.4 to 10.5.5 in /build/javascript Bumps [preact](https://github.com/preactjs/preact) from 10.5.4 to 10.5.5. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.5.4...10.5.5) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owncast <owncast@owncast.online> * Bump @justinribeiro/lite-youtube in /build/javascript Bumps [@justinribeiro/lite-youtube](https://github.com/justinribeiro/lite-youtube) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/justinribeiro/lite-youtube/releases) - [Commits](https://github.com/justinribeiro/lite-youtube/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Owncast <owncast@owncast.online> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
19
build/javascript/node_modules/preact/test-utils/package.json
generated
vendored
Normal file
19
build/javascript/node_modules/preact/test-utils/package.json
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "test-utils",
|
||||
"amdName": "preactTestUtils",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Test-utils for Preact",
|
||||
"main": "dist/testUtils.js",
|
||||
"module": "dist/testUtils.module.js",
|
||||
"umd:main": "dist/testUtils.umd.js",
|
||||
"source": "src/index.js",
|
||||
"license": "MIT",
|
||||
"types": "src/index.d.ts",
|
||||
"peerDependencies": {
|
||||
"preact": "^10.0.0"
|
||||
},
|
||||
"mangle": {
|
||||
"regex": "^_"
|
||||
}
|
||||
}
|
||||
3
build/javascript/node_modules/preact/test-utils/src/index.d.ts
generated
vendored
Normal file
3
build/javascript/node_modules/preact/test-utils/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export function setupRerender(): () => void;
|
||||
export function act(callback: () => void | Promise<void>): Promise<void>;
|
||||
export function teardown(): void;
|
||||
117
build/javascript/node_modules/preact/test-utils/src/index.js
generated
vendored
Normal file
117
build/javascript/node_modules/preact/test-utils/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
import { options } from 'preact';
|
||||
|
||||
/**
|
||||
* Setup a rerender function that will drain the queue of pending renders
|
||||
* @returns {() => void}
|
||||
*/
|
||||
export function setupRerender() {
|
||||
options.__test__previousDebounce = options.debounceRendering;
|
||||
options.debounceRendering = cb => (options.__test__drainQueue = cb);
|
||||
return () => options.__test__drainQueue && options.__test__drainQueue();
|
||||
}
|
||||
|
||||
const isThenable = value => value != null && typeof value.then == 'function';
|
||||
|
||||
/** Depth of nested calls to `act`. */
|
||||
let actDepth = 0;
|
||||
|
||||
/**
|
||||
* Run a test function, and flush all effects and rerenders after invoking it.
|
||||
*
|
||||
* Returns a Promise which resolves "immediately" if the callback is
|
||||
* synchronous or when the callback's result resolves if it is asynchronous.
|
||||
*
|
||||
* @param {() => void|Promise<void>} cb The function under test. This may be sync or async.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
export function act(cb) {
|
||||
if (++actDepth > 1) {
|
||||
// If calls to `act` are nested, a flush happens only when the
|
||||
// outermost call returns. In the inner call, we just execute the
|
||||
// callback and return since the infrastructure for flushing has already
|
||||
// been set up.
|
||||
//
|
||||
// If an exception occurs, the outermost `act` will handle cleanup.
|
||||
const result = cb();
|
||||
if (isThenable(result)) {
|
||||
return result.then(() => {
|
||||
--actDepth;
|
||||
});
|
||||
}
|
||||
--actDepth;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const previousRequestAnimationFrame = options.requestAnimationFrame;
|
||||
const rerender = setupRerender();
|
||||
|
||||
/** @type {() => void} */
|
||||
let flush, toFlush;
|
||||
|
||||
// Override requestAnimationFrame so we can flush pending hooks.
|
||||
options.requestAnimationFrame = fc => (flush = fc);
|
||||
|
||||
const finish = () => {
|
||||
try {
|
||||
rerender();
|
||||
while (flush) {
|
||||
toFlush = flush;
|
||||
flush = null;
|
||||
|
||||
toFlush();
|
||||
rerender();
|
||||
}
|
||||
teardown();
|
||||
} catch (e) {
|
||||
if (!err) {
|
||||
err = e;
|
||||
}
|
||||
}
|
||||
|
||||
options.requestAnimationFrame = previousRequestAnimationFrame;
|
||||
--actDepth;
|
||||
};
|
||||
|
||||
let err;
|
||||
let result;
|
||||
|
||||
try {
|
||||
result = cb();
|
||||
} catch (e) {
|
||||
err = e;
|
||||
}
|
||||
|
||||
if (isThenable(result)) {
|
||||
return result.then(finish, err => {
|
||||
finish();
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
// nb. If the callback is synchronous, effects must be flushed before
|
||||
// `act` returns, so that the caller does not have to await the result,
|
||||
// even though React recommends this.
|
||||
finish();
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
/**
|
||||
* Teardown test environment and reset preact's internal state
|
||||
*/
|
||||
export function teardown() {
|
||||
if (options.__test__drainQueue) {
|
||||
// Flush any pending updates leftover by test
|
||||
options.__test__drainQueue();
|
||||
delete options.__test__drainQueue;
|
||||
}
|
||||
|
||||
if (typeof options.__test__previousDebounce != 'undefined') {
|
||||
options.debounceRendering = options.__test__previousDebounce;
|
||||
delete options.__test__previousDebounce;
|
||||
} else {
|
||||
options.debounceRendering = undefined;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user