- Install Jest for unit testing with React Testing Library - Install Playwright for end-to-end testing - Configure Jest with proper TypeScript support and module mapping - Create test setup files and utilities for both unit and e2e tests Components: * Jest configuration with coverage thresholds * Playwright configuration with browser automation * Unit tests for LoginForm, AuthContext, and useSocketIO hook * E2E tests for authentication, dashboard, and agents workflows * GitHub Actions workflow for automated testing * Mock data and API utilities for consistent testing * Test documentation with best practices Testing features: - Unit tests with 70% coverage threshold - E2E tests with API mocking and user journey testing - CI/CD integration for automated test runs - Cross-browser testing support with Playwright - Authentication system testing end-to-end 🚀 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = compose;
|
|
|
|
var _seq = require('./seq.js');
|
|
|
|
var _seq2 = _interopRequireDefault(_seq);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
/**
|
|
* Creates a function which is a composition of the passed asynchronous
|
|
* functions. Each function consumes the return value of the function that
|
|
* follows. Composing functions `f()`, `g()`, and `h()` would produce the result
|
|
* of `f(g(h()))`, only this version uses callbacks to obtain the return values.
|
|
*
|
|
* If the last argument to the composed function is not a function, a promise
|
|
* is returned when you call it.
|
|
*
|
|
* Each function is executed with the `this` binding of the composed function.
|
|
*
|
|
* @name compose
|
|
* @static
|
|
* @memberOf module:ControlFlow
|
|
* @method
|
|
* @category Control Flow
|
|
* @param {...AsyncFunction} functions - the asynchronous functions to compose
|
|
* @returns {Function} an asynchronous function that is the composed
|
|
* asynchronous `functions`
|
|
* @example
|
|
*
|
|
* function add1(n, callback) {
|
|
* setTimeout(function () {
|
|
* callback(null, n + 1);
|
|
* }, 10);
|
|
* }
|
|
*
|
|
* function mul3(n, callback) {
|
|
* setTimeout(function () {
|
|
* callback(null, n * 3);
|
|
* }, 10);
|
|
* }
|
|
*
|
|
* var add1mul3 = async.compose(mul3, add1);
|
|
* add1mul3(4, function (err, result) {
|
|
* // result now equals 15
|
|
* });
|
|
*/
|
|
function compose(...args) {
|
|
return (0, _seq2.default)(...args.reverse());
|
|
}
|
|
module.exports = exports.default; |