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:
26
frontend/node_modules/detect-newline/index.d.ts
generated
vendored
Normal file
26
frontend/node_modules/detect-newline/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
declare const detectNewline: {
|
||||
/**
|
||||
Detect the dominant newline character of a string.
|
||||
|
||||
@returns The detected newline or `undefined` when no newline character is found.
|
||||
|
||||
@example
|
||||
```
|
||||
import detectNewline = require('detect-newline');
|
||||
|
||||
detectNewline('foo\nbar\nbaz\r\n');
|
||||
//=> '\n'
|
||||
```
|
||||
*/
|
||||
(string: string): '\r\n' | '\n' | undefined;
|
||||
|
||||
/**
|
||||
Detect the dominant newline character of a string.
|
||||
|
||||
@returns The detected newline or `\n` when no newline character is found or the input is not a string.
|
||||
*/
|
||||
graceful(string: string): '\r\n' | '\n';
|
||||
graceful(string?: unknown): '\n';
|
||||
};
|
||||
|
||||
export = detectNewline;
|
||||
21
frontend/node_modules/detect-newline/index.js
generated
vendored
Normal file
21
frontend/node_modules/detect-newline/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const detectNewline = string => {
|
||||
if (typeof string !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
const newlines = string.match(/(?:\r?\n)/g) || [];
|
||||
|
||||
if (newlines.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const crlf = newlines.filter(newline => newline === '\r\n').length;
|
||||
const lf = newlines.length - crlf;
|
||||
|
||||
return crlf > lf ? '\r\n' : '\n';
|
||||
};
|
||||
|
||||
module.exports = detectNewline;
|
||||
module.exports.graceful = string => (typeof string === 'string' && detectNewline(string)) || '\n';
|
||||
9
frontend/node_modules/detect-newline/license
generated
vendored
Normal file
9
frontend/node_modules/detect-newline/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.
|
||||
39
frontend/node_modules/detect-newline/package.json
generated
vendored
Normal file
39
frontend/node_modules/detect-newline/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "detect-newline",
|
||||
"version": "3.1.0",
|
||||
"description": "Detect the dominant newline character of a string",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/detect-newline",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"newline",
|
||||
"linebreak",
|
||||
"line-break",
|
||||
"line",
|
||||
"lf",
|
||||
"crlf",
|
||||
"eol",
|
||||
"linefeed",
|
||||
"character",
|
||||
"char"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
42
frontend/node_modules/detect-newline/readme.md
generated
vendored
Normal file
42
frontend/node_modules/detect-newline/readme.md
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# detect-newline [](https://travis-ci.org/sindresorhus/detect-newline)
|
||||
|
||||
> Detect the dominant newline character of a string
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install detect-newline
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const detectNewline = require('detect-newline');
|
||||
|
||||
detectNewline('foo\nbar\nbaz\r\n');
|
||||
//=> '\n'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### detectNewline(string)
|
||||
|
||||
Returns the detected newline or `undefined` when no newline character is found.
|
||||
|
||||
### detectNewline.graceful(unknown)
|
||||
|
||||
Returns the detected newline or `\n` when no newline character is found or the input is not a string.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [detect-newline-cli](https://github.com/sindresorhus/detect-newline-cli) - CLI for this module
|
||||
- [detect-indent](https://github.com/sindresorhus/detect-indent) - Detect the indentation of code
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user