Set up comprehensive frontend testing infrastructure
- 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>
This commit is contained in:
39
frontend/node_modules/p-try/index.d.ts
generated
vendored
Normal file
39
frontend/node_modules/p-try/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
declare const pTry: {
|
||||
/**
|
||||
Start a promise chain.
|
||||
|
||||
@param fn - The function to run to start the promise chain.
|
||||
@param arguments - Arguments to pass to `fn`.
|
||||
@returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error.
|
||||
|
||||
@example
|
||||
```
|
||||
import pTry = require('p-try');
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const value = await pTry(() => {
|
||||
return synchronousFunctionThatMightThrow();
|
||||
});
|
||||
console.log(value);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
```
|
||||
*/
|
||||
<ValueType, ArgumentsType extends unknown[]>(
|
||||
fn: (...arguments: ArgumentsType) => PromiseLike<ValueType> | ValueType,
|
||||
...arguments: ArgumentsType
|
||||
): Promise<ValueType>;
|
||||
|
||||
// TODO: remove this in the next major version, refactor the whole definition to:
|
||||
// declare function pTry<ValueType, ArgumentsType extends unknown[]>(
|
||||
// fn: (...arguments: ArgumentsType) => PromiseLike<ValueType> | ValueType,
|
||||
// ...arguments: ArgumentsType
|
||||
// ): Promise<ValueType>;
|
||||
// export = pTry;
|
||||
default: typeof pTry;
|
||||
};
|
||||
|
||||
export = pTry;
|
||||
9
frontend/node_modules/p-try/index.js
generated
vendored
Normal file
9
frontend/node_modules/p-try/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
const pTry = (fn, ...arguments_) => new Promise(resolve => {
|
||||
resolve(fn(...arguments_));
|
||||
});
|
||||
|
||||
module.exports = pTry;
|
||||
// TODO: remove this in the next major version
|
||||
module.exports.default = pTry;
|
||||
9
frontend/node_modules/p-try/license
generated
vendored
Normal file
9
frontend/node_modules/p-try/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
42
frontend/node_modules/p-try/package.json
generated
vendored
Normal file
42
frontend/node_modules/p-try/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "p-try",
|
||||
"version": "2.2.0",
|
||||
"description": "`Start a promise chain",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/p-try",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"try",
|
||||
"resolve",
|
||||
"function",
|
||||
"catch",
|
||||
"async",
|
||||
"await",
|
||||
"promises",
|
||||
"settled",
|
||||
"ponyfill",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"bluebird"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
58
frontend/node_modules/p-try/readme.md
generated
vendored
Normal file
58
frontend/node_modules/p-try/readme.md
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# p-try [](https://travis-ci.org/sindresorhus/p-try)
|
||||
|
||||
> Start a promise chain
|
||||
|
||||
[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install p-try
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const pTry = require('p-try');
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const value = await pTry(() => {
|
||||
return synchronousFunctionThatMightThrow();
|
||||
});
|
||||
console.log(value);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pTry(fn, ...arguments)
|
||||
|
||||
Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error.
|
||||
|
||||
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.
|
||||
|
||||
#### fn
|
||||
|
||||
The function to run to start the promise chain.
|
||||
|
||||
#### arguments
|
||||
|
||||
Arguments to pass to `fn`.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user